Arquivos
hhvm/hphp/test/quick/continue.php
T
Owen Yamauchi 86eb82ec2f Fix break/continue parsing
This is exactly what Zend's parser does now. I'm a little sad about
adding the bool parameter, but all the checking code was exactly
duplicated otherwise, and that seemed like the worse alternative.

Fixes #854
2013-07-18 17:28:38 -07:00

43 linhas
607 B
PHP

<?php
function bare_break_continue() {
// This should emit properly; it's not an include-time fatal
break;
continue;
}
function test() {
$three = array(1, 2, 3);
$four = array(1, 2, 3, 4);
foreach ($three as $x) {
if ($x == 2) {
continue;
}
echo $x;
}
echo "\n";
foreach ($three as $x) {
foreach ($four as $y) {
if ($y == 3) {
continue 2;
}
echo $y;
}
}
echo "\n";
foreach ($three as $x) {
foreach ($four as $y) {
if ($y == 3) {
continue (100 - 98);
}
echo $y;
}
}
echo "\n";
}
test();