call_user_func_array
Call a user function given with an array of parameters
&reftitle.description;
mixedcall_user_func_array
callbackfunction
arrayparam_arr
Call a user defined function with the parameters in
param_arr.
&reftitle.parameters;
function
The function to be called.
param_arr
The parameters to be passed to the function, as an indexed array.
&reftitle.returnvalues;
Returns the function result, or &false; on error.
&reftitle.changelog;
&Version;
&Description;
5.3.0
The interpretation of object oriented keywords like parent
and self has changed. Previously, calling them using the
double colon syntax would emit an E_STRICT warning because
they were interpreted as static.
&reftitle.examples;
call_user_func_array example
bar() method with 2 arguments
$foo = new foo;
call_user_func_array(array($foo, "bar"), array("three", "four"));
?>
]]>
&example.outputs.similar;
call_user_func_array using namespace name
]]>
&example.outputs.similar;
Using lambda function
]]>
&example.outputs;
&reftitle.notes;
Referenced variables in param_arr are passed to the
function by reference, regardless of whether the function expects the
respective parameter to be passed by reference. This form of call-time
pass by reference does not emit a deprecation notice, but it is nonetheless
deprecated, and will most likely be removed in the next version of PHP.
Furthermore, this does not apply to internal functions, for which
the function signature is honored. Passing by value when the function expects
a parameter by reference results in a warning and having
call_user_func return &false; (does not apply if the
passed value has a reference count = 1).
¬e.func-callback-exceptions;
&reftitle.seealso;
call_user_func
&seealso.callback;