You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Arguably we shouldn't have written this anyway, but we've found that the following is now a compile time error in PHP instead of a runtime error:
$ less tmp.php
<?php
function hello() {
if (true) {
continue;
}
}
$ php56 tmp.php
$ php70 tmp.php
PHP Fatal error: 'continue' not in the 'loop' or 'switch' context in tmp.php on line 5
It was a fatal runtime error in PHP5.6 but because it was nested inside some error handling code in our case it was never hit. Same is true with break.
The text was updated successfully, but these errors were encountered:
Sadly this is one that will be extremely hard to detect. In fact we can never cover all cases of this. Unless someone has a brilliant idea for this ? @jrfnl ?
Ok, this should work. PR #278 should handle this. Testing appreciated, including coming up with more test cases to see if the sniff handles them correctly.
Arguably we shouldn't have written this anyway, but we've found that the following is now a compile time error in PHP instead of a runtime error:
It was a fatal runtime error in PHP5.6 but because it was nested inside some error handling code in our case it was never hit. Same is true with break.
The text was updated successfully, but these errors were encountered: