#27887 [Com]: func_get_args() can't be used as 2nd parameter for functions
| From: | hkh at netnords dot dk | Date: | Wed, 02 Mar 2005 15:19:30 +0000 |
| Subject: | #27887 [Com]: func_get_args() can't be used as 2nd parameter for functions | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-74766@lists.php.net to get a copy of this message | ||
ID: 27887
Comment by: hkh at netnords dot dk
Reported By: dams@php.net
Status: Verified
Bug Type: Scripting Engine problem
Operating System: *
PHP Version: 4CVS, 5CVS (2004-04-06)
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2004-04-06 10:41:55] dams@php.net
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