note 86761 added to language.references.return
| From: | sandaimespaceman at gmail dot com | Date: | Sun, 02 Nov 2008 16:52:31 +0000 |
| Subject: | note 86761 added to language.references.return | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-146059@lists.php.net to get a copy of this message | ||
The &b() function returns a reference of $a in the global scope.
<?php
$a = 0;
function &b()
{
global $a;
return $a;
}
$c = &b();
$c++;
echo
"
\$a: $a
\$b: $c
"
?>
It outputs:
$a: 1 $b: 1
----
Server IP: 216.235.15.211
Probable Submitter: 70.71.75.169
----
Manual Page -- http://www.php.net/manual/en/language.references.return.php
Edit -- https://master.php.net/note/edit/86761
Del: integrated -- https://master.php.net/note/delete/86761/integrated
Del: useless -- https://master.php.net/note/delete/86761/useless
Del: bad code -- https://master.php.net/note/delete/86761/bad+code
Del: spam -- https://master.php.net/note/delete/86761/spam
Del: non-english -- https://master.php.net/note/delete/86761/non-english
Del: in docs -- https://master.php.net/note/delete/86761/in+docs
Del: other reasons-- https://master.php.net/note/delete/86761
Reject -- https://master.php.net/note/reject/86761
Search -- https://master.php.net/manage/user-notes.php