note 9270 added to What References Do
| From: | heathmike at hotmail dot com | Date: | Wed, 25 Oct 2000 16:31:51 +0000 |
| Subject: | note 9270 added to What References Do | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-6905@lists.php.net to get a copy of this message | ||
I think it would also be prudent to explain what happens when you use Global $varname in a function
as Global does not give access to a global variable per se. It creates a reference within the
function to that global variable so a function like:
<?php
function foo(&$bar) {
global $foobar;
$foobar = &$bar;
}
?>
The global $foobar's reference isn't going to change but $foobar inside foo() as a label
or reference will change.
http://www.php.net/manual/language.references.whatdo.php