}
}
+ switch ($bar) {
+ case 0:
+ while ($xyz) {
+ continue 2; // INVALID
+ }
+ case 1:
+ while ($xyz) {
+ continue;
+ }
+ case 2:
+ while ($xyz) {
+ break 2;
+ }
+ }
+
while ($foo) {
switch ($bar) {
case 0:
?>
--EXPECTF--
-Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in %s on line 6
+Warning: "continue" targeting switch is equivalent to "break" in %s on line 6
Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in %s on line 14
-Warning: "continue 2" targeting switch is equivalent to "break 2". Did you mean to use "continue 3"? in %s on line 26
+Warning: "continue 2" targeting switch is equivalent to "break 2" in %s on line 25
+
+Warning: "continue 2" targeting switch is equivalent to "break 2". Did you mean to use "continue 3"? in %s on line 41
if (CG(context).brk_cont_array[cur].is_switch) {
if (depth == 1) {
- zend_error(E_WARNING,
- "\"continue\" targeting switch is equivalent to \"break\". " \
- "Did you mean to use \"continue " ZEND_LONG_FMT "\"?",
- depth + 1);
+ if (CG(context).brk_cont_array[cur].parent == -1) {
+ zend_error(E_WARNING,
+ "\"continue\" targeting switch is equivalent to \"break\"");
+ } else {
+ zend_error(E_WARNING,
+ "\"continue\" targeting switch is equivalent to \"break\". " \
+ "Did you mean to use \"continue " ZEND_LONG_FMT "\"?",
+ depth + 1);
+ }
} else {
- zend_error(E_WARNING,
- "\"continue " ZEND_LONG_FMT "\" targeting switch is equivalent to \"break " ZEND_LONG_FMT "\". " \
- "Did you mean to use \"continue " ZEND_LONG_FMT "\"?",
- depth, depth, depth + 1);
+ if (CG(context).brk_cont_array[cur].parent == -1) {
+ zend_error(E_WARNING,
+ "\"continue " ZEND_LONG_FMT "\" targeting switch is equivalent to \"break " ZEND_LONG_FMT "\"",
+ depth, depth);
+ } else {
+ zend_error(E_WARNING,
+ "\"continue " ZEND_LONG_FMT "\" targeting switch is equivalent to \"break " ZEND_LONG_FMT "\". " \
+ "Did you mean to use \"continue " ZEND_LONG_FMT "\"?",
+ depth, depth, depth + 1);
+ }
}
}
}