xref: /PHP-8.2/Zend/tests/globals_002.phpt (revision 3c68f38f)
1--TEST--
2globals in local scope
3--INI--
4variables_order="egpcs"
5--FILE--
6<?php
7function test() {
8    var_dump(isset($_SERVER));
9    var_dump(empty($_SERVER));
10    var_dump(gettype($_SERVER));
11    var_dump(count($_SERVER));
12
13    var_dump($_SERVER['PHP_SELF']);
14    unset($_SERVER['PHP_SELF']);
15    var_dump($_SERVER['PHP_SELF']);
16
17    unset($_SERVER);
18    var_dump($_SERVER);
19}
20
21test();
22
23echo "Done\n";
24?>
25--EXPECTF--
26bool(true)
27bool(false)
28string(5) "array"
29int(%d)
30string(%d) "%s"
31
32Warning: Undefined array key "PHP_SELF" in %s on line %d
33NULL
34
35Warning: Undefined global variable $_SERVER in %s on line %d
36NULL
37Done
38