Project

General

Profile

Actions

Bug #9365

closed

Use of "continue" in switch statements can be ambiguous

Added by Jim Pingle about 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
PHP Interpreter
Target version:
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.

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
Actions #1

Updated by Jim Pingle about 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
Actions #2

Updated by Jim Pingle about 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

Actions #3

Updated by Jim Pingle about 5 years ago

  • Category changed from Unknown to PHP Interpreter
Actions #4

Updated by Steve Wheeler about 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
Actions #5

Updated by Jim Pingle about 5 years ago

I just pushed a fix for the lcdproc errors. Looks like those continue statements were unnecessary and could be removed.

Actions #6

Updated by Jim Pingle almost 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

Also available in: Atom PDF