'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.
- 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
In PHP, such
continue
statements are equivalent tobreak
, that is, they end the execution of the currentswitch
structure.In other languages, such
continue
statements behave ascontinue 2
in 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.
Here you can find the description of settings available for the 'continue' is targeting 'switch' statement inspection, and the reference of their default values.
Inspection Details | |
---|---|
By default bundled with: | IntelliJ IDEA 2024.3, PhpStorm 2024.3, Qodana for JVM 2024.3, Qodana for PHP 2024.3, |
Can be installed with plugin: | PHP, 243.23126 |
Thanks for your feedback!