$GLOBALSReferences all variables available in global scope DescriptionAn associative array containing references to all variables which are currently defined in the global scope of the script. The variable names are the keys of the array. Examples
Example #1 $GLOBALS example
The above example will output something similar to: $foo in global scope: Example content $foo in current scope: local variable Warning
As of PHP 8.1.0, write access to the entire $GLOBALS array is no longer supported: Example #2 writing entire $GLOBALS will result in error.
Notes
|