'continue' is targeting 'switch' statement
Reports the continue statements that are targeting switch statements. In PHP 7.3 and later, such usages are deprecated and will emit an E_WARNING, since they are most likely the result of a programming mistake.
Locating this inspection
- By ID
Can be used to locate inspection in e.g. Qodana configuration files, where you can quickly enable or disable it, or adjust its settings.
PhpContinueTargetingSwitchInspection- Via Settings dialog
Path to the inspection settings via IntelliJ Platform IDE Settings dialog, when you need to adjust inspection settings directly from your IDE.
In PHP, such
continuestatements are equivalent tobreak, that is, they end the execution of the currentswitchstructure.In other languages, such
continuestatements behave ascontinue 2in PHP, that is, they take the execution to a higher level control structure (for example, the next iteration of an outer loop).
See continue (php.net), break (php.net), and switch (php.net) for details.
Inspection options
Here you can find the description of settings available for the 'continue' is targeting 'switch' statement inspection, and the reference of their default values.
- PHP 7.3 Severity
Default value:
WarningOther available settings:
Error
Weak Warning
Server Problem
Grammar Error
Typo
Consideration
Information
Suppressing Inspection
You can suppress this inspection by placing the following comment marker before the code fragment where you no longer want messages from this inspection to appear:
More detailed instructions as well as other ways and options that you have can be found in the product documentation:
Inspection Details | |
|---|---|
By default bundled with: | IntelliJ IDEA 2025.2, PhpStorm 2025.2, Qodana for JVM 2025.2, Qodana for PHP 2025.2, |