note 13995 deleted from language.references.return by sniper
| From: | sniper@php.net | Date: | Tue, 30 Sep 2003 01:25:33 +0000 |
| Subject: | note 13995 deleted from language.references.return by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57349@lists.php.net to get a copy of this message | ||
Note Submitter: eivie@liberate.com
----
Try this for kicks:
function &reference()
{ global $x; $x=FALSE;return $x;}
function inside()
{$x=&reference();print " inside: ".(($x)?"1":"0");}
$x=&reference();print " main x: ".(($x)?"1":"0");
$y=&reference();print " main y: ".(($y)?"1":"0");
inside();
//prints main x:1 main y:0 inside:0
So, umm, be careful with these globals and references combined, as they evidently can get a little
screwy when crossed.