|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-04-29 12:24 UTC] kalle@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 16:00:01 2025 UTC |
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