Arquivos
hhvm/hphp/test/slow/array_for_each/457.php
T
Paul Tarjan c2ec1c97c9 sortof format slow tests
A poor man's formatter since I didn't like any of the other ones I found. The original C++ source sometimes put newlines and sometimes not.

Codemods:

    codemod '([;{}])([^\n])' '\1\n\2'
    codemod -m '\s*<\?php\s+' '<?php\n\n'
    codemod '\t' '  '

I hand-fixed all the failing tests
2013-05-30 17:32:57 -07:00

26 linhas
445 B
PHP

<?php
function f6() {
$i = 0;
$foo = array('f'=>3, 'e'=>1, 'd'=>5, 'a'=>6, 'b'=>2, 'c'=>4);
$a = 0;
foreach ($foo as $key => &$val) {
echo "key=$key val=$val\n";
if ($key == 'e' && $a == 0) {
$a = 1;
unset($foo['e']);
unset($foo['d']);
$bar['e'] = 8;
$foo['d'] = 9;
for ($j = 0;
$j < 10000;
++$j)
$foo[$j . 's' . $j] = $j;
}
++$i;
if ($i >= 20)
break;
}
}
f6();