$foo in global scope: Example content
$foo in current scope: local variable

Notes

Note:

This is a 'superglobal', or
automatic global, variable. This simply means that it is available in
all scopes throughout a script. There is no need to do
global $variable; to access it within functions or methods.

Note:
Variable availability

Unlike all of the other superglobals,
$GLOBALS has essentially always been available in PHP.

As of PHP 5.4 $GLOBALS is now initialized just-in-time. This means there now is an advantage to not use the $GLOBALS variable as you can avoid the overhead of initializing it. How much of an advantage that is I'm not sure, but I've never liked $GLOBALS much anyways.

http://www.php.net/manual/en/language.variables.variable.php-------------------------------------WarningPlease note that variable variables cannot be used with PHP's Superglobal arrays within functions or class methods. The variable $this is also a special variable that cannot be referenced dynamically.-------------------------------------