note 71580 deleted from functions.arguments by colder
| From: | colder@php.net | Date: | Wed, 06 Dec 2006 18:03:11 +0000 |
| Subject: | note 71580 deleted from functions.arguments by colder | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-120346@lists.php.net to get a copy of this message | ||
Note Submitter: johnfactorial at gmail dot com
Reason: integrated
----
Note that you can't skip one parameter with a default value and specify the value of another
one. E.g.:
function foo($a, $b=3, $c=5) {
echo "foo: $a, $b, $c";
}
foo(1); //works fine
foo(1, 2); //also works fine
But, if you want to specify a value for $a and $c but not $b, there is no straightforward way to do
it.
foo(1, , 3); //parse error
foo(1, null, 3); //$b = null