Req #20706 [Opn->Wfx]: skipping an optional argument
| From: | jani@php.net | Date: | Fri, 31 Dec 2010 22:57:42 +0000 |
| Subject: | Req #20706 [Opn->Wfx]: skipping an optional argument | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-157430@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=20706&edit=1
ID: 20706
Updated by: jani@php.net
Reported by: jeremyirons at genevus dot com
Summary: skipping an optional argument
-Status: Open
+Status: Wont fix
Type: Feature/Change Request
-Package: Feature/Change Request
+Package: *General Issues
PHP Version: 4.2.3
Block user comment: N
Private report: N
New Comment:
Use arrays for something like this. No way this should be ever
implemented, that looks just like a typo instead of intentionalö.
Previous Comments:
------------------------------------------------------------------------
[2002-11-28 15:21:16] 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
}
test("hello",,7);
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!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/bug.php?id=20706&edit=1