Answer the question
In order to leave comments, you need to log in
How to use reflection on a method?
There is an array, it contains arguments $params = ['arg1' => 10, 'arg2' => 20];
AND a method that takes these arguments public function method($a, $b) {return $a+$b;}
For classes there is such a thing
$reflection = new \ReflectionClass( $class );
$instance = $reflection->newInstanceArgs( $args );
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question