我已经看到了
PHP手册.但是我不明白早期版本和更高版本的PHP之间的行为差异.我不明白这个说法:
Because this function depends on the current scope to determine parameter details,it cannot be used as a function parameter in versions prior to 5.3.0. If this value must be passed,the results should be assigned to a variable,and that variable should be passed.
如果要将其中一个函数的结果传递给另一个函数或方法,那么在5.3之前的PHP版本中,您必须首先将结果分配给变量.
function some_func() { $args = func_get_args(); some_other_func($args); }
PHP 5.3中删除了这个限制,现在可以直接传递结果.
function some_func() { some_other_func(func_get_args()); }
至于为什么这个限制首先存在,也许有一个更全面了解PHP内部的人可以给你一个更完整的答案.