ID: 48106 Updated by: ka...@php.net Reported By: djungowski at chip dot de -Status: Open +Status: Bogus -Bug Type: Reproducible crash +Bug Type: Scripting Engine problem Operating System: Linux PHP Version: 5.2.9 New Comment:
This is a known issue and have been fixed in 5.3. Previous Comments: ------------------------------------------------------------------------ [2009-04-29 12:09:42] djungowski at chip dot de 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 this bug report at http://bugs.php.net/?id=48106&edit=1