|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-04-06 10:41 UTC] 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());
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 30 09:00:02 2025 UTC |
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.