Using, probably, the ReflectionClass, how could I know how many parameters is a method expecting?
class Test {
public function mymethod($one, $two, $three = '') {}
public function anothermethod($four) {}
}
$test = new Test();
$i = function_im_looking_for(array($test, 'mymethod'));
$i2 = function_im_looking_for(array($test, 'anothermethod'));
echo $i .' - '. $i2;
The above code should output : 3 - 1
;