note 10564 deleted from language.references.spot by sniper

From: Date: Sun, 13 Jul 2003 03:27:05 +0000
Subject: note 10564 deleted from language.references.spot by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-52012@lists.php.net to get a copy of this message
Note Submitter: s.meudec@nexcom.fr ---- /* in the example below, the reference is lost after the function call, because of the global declaration in the function (or the declaration in global scope ?) : */ global $AA, $BB; $AA = new stdClass; $AA->Desc = 'the description'; $BB = 'a string'; echo var_dump($AA); echo '<br>'; echo var_dump($BB); echo '<hr>'; function foo() { global $AA, $BB; $BB =& $AA; echo 'foo:'; echo var_dump($AA); echo '<br>'; echo var_dump($BB); echo '<hr>'; } foo(); echo var_dump($AA); echo '<br>'; echo var_dump($BB); echo '<hr>';

« previous php.notes (#52012) next »