Arquivos
hhvm/hphp/test/quick/GLOBALS.php
T
ptarjan 503f75d08b Rename test directories
These names don't make sense now that we run both suites the same
way.
2013-04-17 09:06:51 -07:00

26 linhas
392 B
PHP

<?php
print "Test begin\n";
# Get a key that doesn't exist in $GLOBALS.
$k = 'k';
while (isset($GLOBALS[$k])) {
$k .= 'k';
}
$a = $GLOBALS;
$GLOBALS[$k] = 42;
if (isset($GLOBALS[$k])) {
print "Key is set in \$GLOBALS\n";
}
if (isset($a[$k])) {
print "Key set visible via \$a\n";
}
$b = $a;
$a[$k]++;
if ($b[$k] == 43) {
print "Key update visible via \$b\n";
}
print "Test end\n";