From: djungowski at chip dot de
Operating system: Linux
PHP version: 5.2.9
PHP Bug Type: Reproducible crash
Bug description: func_get_args() causes Fatal Error when used as second
function parameter
Description:
------------
When func_get_args() is used as second (or third or fourth...) parameter
in a function/method call, it causes a Fatal error. Yet when used as first
parameter, everything works fine.
No fatal error occurs when any other function is used as second parameter,
so it seems to be a func_get_args() problem only.
This problem also occurs in earlier PHP versions (5.2.6, 5.2.4, etc)
I know this bug has been reported before (#27887), but has been closed
with a - I'm sorry to say this - lame explanation. This is a bug, no matter
what the documentation says.
Reproduce code:
---------------
function returnSomething()
{
return func_get_args();
}
function callSomeFunction($message)
{
someFunction(func_get_args(), 'Hello World');
someFunction(1, returnSomething());
someFunction(1, func_get_args());
}
function someFunction($code, $message)
{
print($message . PHP_EOL);
}
callSomeFunction('Hello World');
Expected result:
----------------
Hello World
Array
Array
Actual result:
--------------
Hello World
Array
Fatal error: func_get_args(): Can't be used as a function parameter in
/home/dominik/test.php on line 12
--
Edit bug report at http://bugs.php.net/?id=48106&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=48106&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=48106&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=48106&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=48106&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=48106&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=48106&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=48106&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=48106&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=48106&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=48106&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=48106&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=48106&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=48106&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=48106&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=48106&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=48106&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=48106&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=48106&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=48106&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=48106&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=48106&r=mysqlcfg