Working on a new MVC Application Framework i use this method to check how many arguments are required before calling the sub method!
Example
<?php
$this->method_args_count = $this->CReflection
->getMethod($Route->getMethod())
->getNumberOfParameters();
$this->params = $Route->getParams(); if($this->method_args_count > count($this->params))
{
$this->difference = ($this->method_args_count - count($this->params));
for($i=0;$i<=$this->difference;$i++)
{
$this->params[] = false;
}
}
call_user_func_array(array(new $this->obj,$Route->getMethod()),$this->params);
?>