From: [EMAIL PROTECTED] Operating system: All PHP version: 4.2.0 PHP Bug Type: Feature/Change Request Bug description: Omitting defaulted arguments
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 -- Edit bug report at http://bugs.php.net/?id=17076&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=17076&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=17076&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=17076&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=17076&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=17076&r=support Expected behavior: http://bugs.php.net/fix.php?id=17076&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=17076&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=17076&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=17076&r=globals