Bug #9365
closed
Use of "continue" in switch statements can be ambiguous
Added by Jim Pingle almost 6 years ago.
Updated over 5 years ago.
Affected Architecture:
All
Description
PHP 7.3 is tightening down on the use of continue
in switches. There are instances where the code meant to continue through a foreach
or other loop but didn't have the right number set on continue
statements, which made them equivalent to a break
which was most likely not what was intended.
http://php.net/manual/en/migration73.incompatible.php#migration73.incompatible.core.continue-targeting-switch
Below are the errors spotted so far. Add more in comments.
PHP Warning: "continue 2" targeting switch is equivalent to "break 2". Did you mean to use "continue 3"? in /etc/inc/gwlb.inc on line 747
PHP Warning: "continue 2" targeting switch is equivalent to "break 2". Did you mean to use "continue 3"? in /etc/inc/gwlb.inc on line 889
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /usr/local/pkg/frr/inc/frr_zebra.inc on line 211
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /usr/local/pkg/frr/inc/frr_zebra.inc on line 572
- Subject changed from Use of "continue" in switches can be ambiguous to Use of "continue" in switch statements can be ambiguous
- Affected Version set to 2.5.0
Two more:
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /usr/local/www/interfaces.php on line 2644
PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /usr/local/www/system.php on line 142
- Category changed from Unknown to PHP Interpreter
Seeing in lcdproc too. Seems to be working OK though.
[19-Mar-2019 19:07:01 Europe/London] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /usr/local/pkg/lcdproc.inc on line 83
[19-Mar-2019 19:07:01 Europe/London] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /usr/local/pkg/lcdproc.inc on line 102
[19-Mar-2019 19:07:01 Europe/London] PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /usr/local/pkg/lcdproc.inc on line 118
I just pushed a fix for the lcdproc errors. Looks like those continue
statements were unnecessary and could be removed.
- Status changed from New to Closed
- % Done changed from 0 to 100
All the ones we have found so far are now fixed. If new ones pop up, open new issues for them.
Also available in: Atom
PDF