Entry
Why does GLOBALS['GLOBALS'] ... exists in PHP 5.0.4? What purpose does it have? Bug?
Oct 8th, 2006 10:05
Matthew Wilkinson, DDA 776, http://uk.php.net/manual/en/reserved.variables.php#reserved.variables.globals
$GLOBALS is an automatically updated array that contains ABSOLUTELY
every single variable in the global scope of the currently running
script. Since every variable is included, it includes itself, since it
is in the global scope. Be careful when iterating through it as
$GLOBALS['GLOBALS'] is infinitely recursive, eg.
$GLOBALS['GLOBALS']['GLOBALS']['GLOBALS']......
No this is not a bug in the PHP engine, it is purposefully placed there.