Arquivos
hhvm/hphp/test/vm/GLOBALS.php
T
Jordan Delong 363d1bb20f Code move src/ -> hphp/
This change is mostly for FB internal organizational reasons.
Building is not effected beyond the fact that the target now
lands in hphp/hhvm/hhvm rather than src/hhvm/hhvm.
2013-02-11 02:10:41 -08: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";