|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-11-20 15:26 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2020-11-20 15:26 UTC] requinix@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 16 16:00:01 2025 UTC |
Description: ------------ Function cannot fetch its arguments with func_* functions after last one passed by its name. Test script: --------------- function test_func($arg1 = 'a', $arg2 = 'b', $arg3 = 'c', $arg4 = 'd') { return json_encode([ 'func_num_args' => func_num_args(), 'func_get_args' => func_get_args(), 'direct_args' => [$arg1, $arg2, $arg3, $arg4], ], JSON_PRETTY_PRINT); } echo test_func(arg1: 'hello', arg3: 'world'); Expected result: ---------------- { "func_num_args": 4, "func_get_args": [ "hello", "b", "world", "d" ], "direct_args": [ "hello", "b", "world", "d" ] } Actual result: -------------- { "func_num_args": 3, "func_get_args": [ "hello", "b", "world" ], "direct_args": [ "hello", "b", "world", "d" ] }