note 13995 added to language.references.return.php
| From: | eivie at liberate dot com | Date: | Thu, 12 Jul 2001 18:44:37 +0000 |
| Subject: | note 13995 added to language.references.return.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15297@lists.php.net to get a copy of this message | ||
Try this for kicks:
$db=fetch_database_connection();
print "DB:".$db;
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.
http://www.php.net/manual/en/language.references.return.php