ID: 27887 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Verified +Status: Feedback Bug Type: Scripting Engine problem Operating System: * PHP Version: 5CVS, 4CVS (2004-04-06) New Comment:
Damien, the docs say: "This function cannot be used directly as a function parameter. Instead, its result may be assigned to a variable, which can then be passed to the function.", so don't use it as a parameter. Previous Comments: ------------------------------------------------------------------------ [2005-03-02 16:19:29] hkh at netnords dot dk Reproduce code: function a() { print func_num_args().'<br />'; } function b() { $dd = 123; a(func_get_args()); a(func_get_args(), $dd); a($dd, func_get_args()); } b('Hello World'); ------------------------------------------ Expected result: 1 2 2 ------------------------------------------ Actual result: 1 2 Fatal error: func_get_args(): Can't be used as a function parameter in ......... ------------------------------------------ Comment: I tested the code with same result on 4.3.10-1.dotdeb.0 and 5.0.3-1.dotdeb.0. I think all the lines should fails on none of them. Can't see anything in the documentation about this. ------------------------------------------------------------------------ [2004-04-06 10:41:55] [EMAIL PROTECTED] Description: ------------ when passing func_get_args() as second parameter of a function, it complains. foo('foo', func_get_args()); Fatal error: func_get_args(): Can't be used as a function parameter in /Users/iboom/Desktop/Journaux/ 2004.04/fonctions/arg_defaut.php on line 23 foo(func_get_args(), 'foo'); is OK tough. So, it won't work with print join(',',func_get_args()); array_map('foo',func_get_args()); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=27887&edit=1