note 93035 added to language.references.pass
| From: | justin at ilithium dot com | Date: | Thu, 20 Aug 2009 10:14:49 +0000 |
| Subject: | note 93035 added to language.references.pass | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-159681@lists.php.net to get a copy of this message | ||
There appears to be no information on how to handle optional pass-by-parameters so I'm posting
an example, in which these optional values are defaulted to NULL, as follows:
function test_ref ($a, $b = NULL)
{
if (is_null($b) === false)
{
$b = "Value set";
return;
}
print "No value set";
}
test without parameter:
{
$a = "test";
test_ref($a);
}
outputs:
No value set
test with parameter:
{
$a = "test";
$b = "test";
test_ref($a, $b);
print $b;
}
outputs:
Value set
----
Server IP: 87.124.86.46
Probable Submitter: 87.194.35.152 (proxied: 87.194.35.152)
----
Manual Page -- http://www.php.net/manual/en/language.references.pass.php
Edit -- https://master.php.net/note/edit/93035
Del: integrated -- https://master.php.net/note/delete/93035/integrated
Del: useless -- https://master.php.net/note/delete/93035/useless
Del: bad code -- https://master.php.net/note/delete/93035/bad+code
Del: spam -- https://master.php.net/note/delete/93035/spam
Del: non-english -- https://master.php.net/note/delete/93035/non-english
Del: in docs -- https://master.php.net/note/delete/93035/in+docs
Del: other reasons-- https://master.php.net/note/delete/93035
Reject -- https://master.php.net/note/reject/93035
Search -- https://master.php.net/manage/user-notes.php