Arquivos
hhvm/hphp/test/vm/jitarray.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

29 linhas
492 B
PHP

<?php
function f() { return array(); }
function populateArray($max) {
$a = f();
for ($i = 0; $i < $max; ++$i) {
$a[$i] = $i * 9;
}
for ($i = 0; $i < $max; ++$i) {
if ($a[$i] != $i * 9) {
echo "mismatch: "; echo $i; echo ": ";
echo $a[$i]; echo "; should be "; echo $i * 9;
echo "\n";
}
}
}
function main() {
$a = f();
echo "writing: "; echo ($a[1] = 66); echo "\n";
echo "reading: "; echo $a[1]; echo "\n";
populateArray(1000);
}
main();