|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #20706 skipping an optional argument
Submitted: 2002-11-28 15:21 UTC Modified: 2010-12-31 23:57 UTC
Avg. Score:4.3 ± 0.7
Reproduced:5 of 5 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: jeremyirons at genevus dot com Assigned:
Status: Wont fix Package: Scripting Engine problem
PHP Version: 4.2.3 OS:
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.
Block user comment
Status: Assign to:
Bug Type:
From: jeremyirons at genevus dot com
New email:
PHP Version: OS:


 [2002-11-28 15:21 UTC] jeremyirons at genevus dot com
Any reason why the following has never been implemented for optional function arguments?

function test($a, $b = 1, $c = 2)
//do something


What I would like the test function to see would be
$a = "hello"
$b = 1
$c = 7

Since I skipped the second argument, I would like the default value to kick in. This would be really useful!


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-31 23:57 UTC]
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2010-12-31 23:57 UTC]
Use arrays for something like this. No way this should be ever implemented, that looks just like a typo instead of intentionalö.
 [2010-12-31 23:57 UTC]
-Package: *General Issues +Package: Scripting Engine problem
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Sep 26 02:05:52 2022 UTC