Actions
Bug #9365
closedUse of "continue" in switch statements can be ambiguous
Start date:
03/05/2019
Due date:
% Done:
100%
Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.5.0
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.
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
Updated by Jim Pingle over 5 years ago
- 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
Updated by Jim Pingle over 5 years ago
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
Updated by Jim Pingle over 5 years ago
- Category changed from Unknown to PHP Interpreter
Updated by Steve Wheeler over 5 years ago
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
Updated by Jim Pingle over 5 years ago
I just pushed a fix for the lcdproc errors. Looks like those continue
statements were unnecessary and could be removed.
Updated by Jim Pingle over 5 years ago
- 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.
Actions