note 9270 modified in language.references.whatdo by irc-html
| From: | irc-html@php.net | Date: | Sat, 19 Jan 2002 19:51:28 +0000 |
| Subject: | note 9270 modified in language.references.whatdo by irc-html | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-25287@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.
--was--
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/en/language.references.whatdo.php