note 83298 added to language.references.pass
| From: | mehea at osu1 dot php dot net | Date: | Tue, 20 May 2008 00:04:04 +0000 |
| Subject: | note 83298 added to language.references.pass | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-139542@lists.php.net to get a copy of this message | ||
New in PHP5: assign default value to
pass-by-reference paramter.
I didn't believe it even when I read
http://devzone.zend.com/article/1714-Whats-New-in-PHP-5
Then I tried this:
function my_func(&$arg = 22) {
if ($arg == 22) {
print '$arg is '. $arg;
}
}
my_func();
Guess what? It works, even tho' not clear about what $arg is actually referencing!
----
Server IP: 209.41.74.194
Probable Submitter: 216.244.36.15
----
Manual Page -- http://www.php.net/manual/en/language.references.pass.php
Edit -- https://master.php.net/note/edit/83298
Del: integrated -- https://master.php.net/note/delete/83298/integrated
Del: useless -- https://master.php.net/note/delete/83298/useless
Del: bad code -- https://master.php.net/note/delete/83298/bad+code
Del: spam -- https://master.php.net/note/delete/83298/spam
Del: non-english -- https://master.php.net/note/delete/83298/non-english
Del: in docs -- https://master.php.net/note/delete/83298/in+docs
Del: other reasons-- https://master.php.net/note/delete/83298
Reject -- https://master.php.net/note/reject/83298
Search -- https://master.php.net/manage/user-notes.php