global statement removal: hphp/test [7/x]
[hiphop-php.git] / hphp / test / quick / GLOBALS.php
blobad88f8e24447be356d2d07a6463b4056c4e42125
1 <?hh
3 print "Test begin\n";
5 # Get a key that doesn't exist in $GLOBALS.
6 $k = 'k';
7 while (isset($GLOBALS[$k])) {
8 $k .= 'k';
11 $a = $GLOBALS;
12 $GLOBALS[$k] = 42;
13 if (isset($GLOBALS[$k])) {
14 print "Key is set in \$GLOBALS\n";
16 if (isset($a[$k])) {
17 print "Key set visible via \$a\n";
19 $b = $a;
20 $a[$k]++;
21 if ($b[$k] == 43) {
22 print "Key update visible via \$b\n";
25 print "Test end\n";