revision 1.136
date: 2004/10/31 15:30:53; author: helly; state: Exp; lines: +163 -1
- Add ReflectionFunction::invokeArgs(array)
- Add ReflectionMethod::invokeArgs(obj, array)
Why was this added?
These:
-
call_user_func_array(
array(new ReflectionMethod('class', 'method'), 'invoke',
array(1, 2, 3)
) -
call_user_func(
array(new ReflectionMethod('class', 'method'), 'invoke',
1, 2, 3
)
work just fine. Do we really need to duplicate code where a solution
already exists?
- Timm
Timm Friebe wrote:
Why was this added?
I asked Marcus to add these.
These:
call_user_func_array(
array(new ReflectionMethod('class', 'method'), 'invoke',
array(1, 2, 3)
)call_user_func(
array(new ReflectionMethod('class', 'method'), 'invoke',
1, 2, 3
)work just fine.
They work, but not seamless.
--
Sebastian Bergmann http://www.sebastian-bergmann.de/
GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69
Timm Friebe wrote:
Why was this added?
I asked Marcus to add these.
He forgot to support invokeArgs(NULL, array(...)) for static invocation
("Warning: invokeArgs() expects parameter 1 to be object, null given").
[...call_user_func* equivalents...]
They work, but not seamless.
Care to elaborate? Except for the call_user_func-syntax being longer I
don't see any difference.
- Timm
Timm Friebe wrote:
Care to elaborate? Except for the call_user_func-syntax being longer I
don't see any difference.
The difference is that with using a method of ReflectionFunction or
ReflectionMethod I do not have to switch paradigms (Reflection API and
OOP vs. call_user_func*() and non-OOP).
--
Sebastian Bergmann http://www.sebastian-bergmann.de/
GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69
Hello Sebastian, hello Timm,
after all the differnece is whether we know of the typical PHP user can
find out.
marcus
p.s.: Timm you're going to FFM?
Tuesday, November 2, 2004, 11:45:18 PM, you wrote:
Timm Friebe wrote:
Care to elaborate? Except for the call_user_func-syntax being longer I
don't see any difference.
The difference is that with using a method of ReflectionFunction or
ReflectionMethod I do not have to switch paradigms (Reflection API and
OOP vs. call_user_func*() and non-OOP).
--
Sebastian Bergmann http://www.sebastian-bergmann.de/
GnuPG Key: 0xB85B5D69 / 27A7 2B14 09E4 98CD 6277 0E5B 6867 C514 B85B 5D69
--
Best regards,
Marcus mailto:helly@php.net