|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-11-18 20:08 UTC] mike@php.net
[2014-11-18 21:31 UTC] ajf at ajf dot me
[2016-07-14 11:08 UTC] dmitry@php.net
-Assigned To:
+Assigned To: nikic
[2016-07-14 11:08 UTC] dmitry@php.net
[2016-07-15 20:07 UTC] nikic@php.net
[2017-01-08 11:03 UTC] nikic@php.net
-Status: Assigned
+Status: Open
-Assigned To: nikic
+Assigned To:
[2017-01-08 15:37 UTC] ajf@php.net
[2020-06-25 08:12 UTC] nikic@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 16:00:01 2025 UTC |
Description: ------------ Optional arguments can be specified before required arguments, which would suggest that you can omit them. Yet, if you actually call the function, it will complain that you didn't pass the required arguments. The fix would be either to support optional arguments before required arguments at call-time, or to error when this is done in a function declaration. Test script: --------------- <?php function foo($a = NULL, $b) { var_dump($b); } foo(2); Expected result: ---------------- int(2) Actual result: -------------- Warning: Missing argument 2 for foo(), called in %s on line 7 and defined in /in/b1HC3 on line 3 Notice: Undefined variable: b in %s on line 4 NULL