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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tsf at post dot cz
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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: Tue Apr 23 08:01:30 2024 UTC