Man Page: reflectionmethod.invokeargs
Operating Environment: php
Section: 3
REFLECTIONMETHOD.INVOKEARGS(3) 1 REFLECTIONMETHOD.INVOKEARGS(3) ReflectionMethod::invokeArgs - Invoke argsSYNOPSISpublic mixed ReflectionMethod::invokeArgs (object $object, array $args)DESCRIPTIONInvokes the reflected method and pass its arguments as array.PARAMETERSo $object - The object to invoke the method on. In case of static methods, you can pass null to this parameter. o $args - The parameters to be passed to the function, as an array.RETURN VALUESReturns the method result.ERRORS/EXCEPTIONS A ReflectionException if the $object parameter does not contain an instance of the class that this method was declared in. A ReflectionException if the method invocation failed.EXAMPLESExample #1 ReflectionMethod::invokeArgs example <?php class HelloWorld { public function sayHelloTo($name) { return 'Hello ' . $name; } } $reflectionMethod = new ReflectionMethod('HelloWorld', 'sayHelloTo'); echo $reflectionMethod->invokeArgs(new HelloWorld(), array('Mike')); ?> The above example will output: Hello MikeNOTESNote If the function has arguments that need to be references, then they must be references in the passed argument list.SEE ALSOReflectionMethod::invoke, __invoke(), call_user_func_array(3). PHP Documentation Group REFLECTIONMETHOD.INVOKEARGS(3)
| Related Man Pages |
|---|
| runkit_method_add(3) - php |
| reflectionfunction(3) - php |
| classkit_method_redefine(3) - php |
| forward_static_call(3) - php |
| forward_static_call_array(3) - php |
| Similar Topics in the Unix Linux Community |
|---|
| problem with spaces and argument parsing |
| Perl nested array problem |
| repetition calculation |
| Store args passed in array but not the first 2 args |