|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-05-07 14:30 UTC] mfischer@php.net
[2008-01-18 20:43 UTC] pete at teamlupus dot hu
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 08:00:02 2025 UTC |
This is an enhancement request for about the only thing that I can think of offhand that exists in VB that I really miss in PHP: I would like to be able to declare, say, function myFunc ($arg0, $arg1="One", $arg2="Two", $arg3=3) and call it thusly: myFunc ("Hi", , "Mom") In other words, if I omit an argument to a function where the value is defaulted (in our example we are talking about position 1, in addition to position 3), PHP should take the default value instead of complaining. Of course I can always figure out what the default value was in the first place by checking the function definition and plunking it into my call explicitely, but isn't this the same convenience that the current method tries to offer us? This is just a proposal to extend it. Motivation: This comes up frequently for me because I have several functions which take 3 parameters which are normally defaulted, and usually at most one varies. So unless it's the first of the three, I have to fill in extra values that distract from what's going on. Thanks for considering this, Csaba Gabor