php-src/Zend/tests/globals_001.phpt
Nikita Popov 3c68f38fda Restrict allowed usages of $GLOBALS
This restricts allowed usage of $GLOBALS, with the effect that
plain PHP arrays can no longer contain INDIRECT elements.

RFC: https://wiki.php.net/rfc/restrict_globals_usage

Closes GH-6487.
2021-01-06 12:46:24 +01:00

35 lines
554 B
PHP

--TEST--
globals in global scope
--INI--
variables_order="egpcs"
--FILE--
<?php
var_dump(isset($_SERVER));
var_dump(empty($_SERVER));
var_dump(gettype($_SERVER));
var_dump(count($_SERVER));
var_dump($_SERVER['PHP_SELF']);
unset($_SERVER['PHP_SELF']);
var_dump($_SERVER['PHP_SELF']);
unset($_SERVER);
var_dump($_SERVER);
echo "Done\n";
?>
--EXPECTF--
bool(true)
bool(false)
string(5) "array"
int(%d)
string(%d) "%s"
Warning: Undefined array key "PHP_SELF" in %s on line %d
NULL
Warning: Undefined global variable $_SERVER in %s on line %d
NULL
Done