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
As of PHP 7.3, using `continue` to target a `switch` control structure will throw an `E_WARNING`.
Applying `continue` to a `switch` is equivalent to using `break` and more often than not, a `continue` targeting a higher level control structure is actually intended.
To target the higher level control structure, a numeric argument has to be passed to `continue`.
Refs:
* php/php-src#3364
* https://wiki.php.net/rfc/continue_on_switch_deprecation
This change has been recently committed to PHP itself and will break the build against `nightly` for the current `master` already. See: https://travis-ci.org/jrfnl/PHP_CodeSniffer/jobs/401533444 (this branch, but without commits, so equal to the current `master`).
This PR fixes the instances of this in PHPCS.
All these switches are nested in other control structures, but end the switch end the scope closer of the outer control structure, so using `break` in these cases would be equivalent to using `continue 2`.
FYI: The PHPCompatibility standard will include a sniff to detect this in the near future.
0 commit comments