PHP Warning: “continue” targeting switch is equivalent to “break”. Did you mean to use “continue 2”
switch ($var) {
case 1:
continue; // This should trigger a warning and suggest replacing with 'break' .
break;
case 2:
for ($i = 0; $i < 10; $i++) {
continue; // This is valid and should be ignored by the sniff.
}
break;
}
Issue:
continue. Although working fine, this generates the following warning from>=PHP 7.3ref.breakinside switch case, followed by processing left if any.Description:
Example: