PHP Sadness

(<5.3) The func_get_args() function can't be used as a parameter

Until PHP 5.3, you have to save the result of php func_get_args to a variable before you can use it in php call_user_func_array.

$ php -r 'function test($a,$b,$c){call_user_func_array("test2",func_get_args());} function test2(){var_dump(func_get_args());} test(1,2,3);'

Fatal error: func_get_args(): Can't be used as a function parameter in Command line code on line 1

But:

$ php -r 'function test($a,$b,$c){$v=func_get_args();call_user_func_array("test2",$v);} function test2(){var_dump(func_get_args());} test(1,2,3);'
array(3) {
  [0]=>
  int(1)
  [1]=>
  int(2)
  [2]=>
  int(3)
}