|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-06-18 01:56 UTC] dtajchreber@php.net
-Status: Open
+Status: Bogus
[2010-06-18 01:56 UTC] dtajchreber@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 22:00:02 2025 UTC |
Description: ------------ Arrays get scrambled when using func_get_args(). See code sample below. Test script: --------------- <?php function foo(/* ... */) { $arguments = func_get_args(); if(isset($arguments[0]['key'])) { var_dump($arguments[0]); var_dump($arguments[1]); echo "You see that \$arguments[0] is a string, while \$arguments[1] is an array.\n"; echo "So this code should never get executed.\n"; } else { echo "Correct behaviour"; } } foo("some string", array("key" => "value")); Expected result: ---------------- Script output: Correct behaviour Actual result: -------------- Script output: string(11) "some string" array(1) { ["key"]=> string(5) "value" } string(1) "s" You see that $arguments[0] is a string, while $arguments[1] is an array. So this code should never get execute.