note 106626 deleted from reserved.variables.globals by thiago
| From: | thiago@php.net | Date: | Tue, 29 Nov 2011 13:00:10 +0000 |
| Subject: | note 106626 deleted from reserved.variables.globals by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-184762@lists.php.net to get a copy of this message | ||
Note Submitter: Anonymous
----
I want to know difference between global and $_GLOBAL
example:
<?php
function test() {
$foo = "local variable";
echo '$foo in global scope: ' . $GLOBALS["foo"] . "\n";
echo '$foo in current scope: ' . $foo . "\n";
}
$foo = "Example content";
test();
?>
if we change this example to:
<?php
function test() {
global $foo = "local variable";
echo '$foo in global scope: ' . $GLOBALS["foo"] . "\n";
echo '$foo in current scope: ' . $foo . "\n";
}
$foo = "Example content";
test();
?>
then what the logical difference...
Rohan