php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #2285 default arguments skipping
Submitted: 1999-09-12 23:51 UTC Modified: 2001-06-08 08:17 UTC
From: tsf at post dot cz Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0 OS: linux
Private report: No CVE-ID: None
 [1999-09-12 23:51 UTC] tsf at post dot cz
when I develop apps, I tend to add more and more arguments
to my functions giving them default values for backward
compatibility. but as soon as your function has more than
14 arguments :) it gets very tiring to write them all...

it would be great if you could specify WHICH arguments you
want to pass to the function... like:

function foo($arg1, $arg2 = 0, $arg3 = "none")
{
  ...
}

foo("wow", $arg3 => "bar");


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-08-17 10:40 UTC] hholzgra@php.net
or maybe at least foo("wow",,"bar") as in list()
 [2001-02-10 13:44 UTC] jimw@php.net
refiled against 4.0. (although you can just pass an array to get named-parameters-like behavior.)
 [2001-06-08 08:17 UTC] cynic@php.net
I think this one may be closed. Ass. array is a sufficient form of named parameters.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 27 01:01:28 2024 UTC