while ($foo) { <--------------------┐
continue; --- goes back here --┘
break; ----- jumps here ----┐
} |
<--------------------┘
这样使用:
while ($droid = searchDroids()) {
if ($droid != $theDroidYoureLookingFor) {
continue; // ..the search with the next droid
}
$foundDroidYoureLookingFor = true;
break; // ..off the search
}
Version Description
7.0.0 - continue outside of a loop or switch control structure is now detected at compile-time instead of run-time as before, and triggers an E_COMPILE_ERROR.
5.4.0 continue 0; is no longer valid. In previous versions it was interpreted the same as continue 1;.
5.4.0 Removed the ability to pass in variables (e.g., $num = 2; continue $num;) as the numerical argument.
休息时间更换日志
Version Description
7.0.0 break outside of a loop or switch control structure is now detected at compile-time instead of run-time as before, and triggers an E_COMPILE_ERROR.
5.4.0 break 0; is no longer valid. In previous versions it was interpreted the same as break 1;.
5.4.0 Removed the ability to pass in variables (e.g., $num = 2; break $num;) as the numerical argument.