1--TEST-- 2Warning on continue targeting switch 3--FILE-- 4<?php 5 6function test() { 7 switch ($foo) { 8 case 0: 9 continue; // INVALID 10 case 1: 11 break; 12 } 13 14 while ($foo) { 15 switch ($bar) { 16 case 0: 17 continue; // INVALID 18 case 1: 19 continue 2; 20 case 2: 21 break; 22 } 23 } 24 25 switch ($bar) { 26 case 0: 27 while ($xyz) { 28 continue 2; // INVALID 29 } 30 case 1: 31 while ($xyz) { 32 continue; 33 } 34 case 2: 35 while ($xyz) { 36 break 2; 37 } 38 } 39 40 while ($foo) { 41 switch ($bar) { 42 case 0: 43 while ($xyz) { 44 continue 2; // INVALID 45 } 46 case 1: 47 while ($xyz) { 48 continue 3; 49 } 50 case 2: 51 while ($xyz) { 52 break 2; 53 } 54 } 55 } 56} 57 58?> 59--EXPECTF-- 60Warning: "continue" targeting switch is equivalent to "break" in %s on line 6 61 62Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in %s on line 14 63 64Warning: "continue 2" targeting switch is equivalent to "break 2" in %s on line 25 65 66Warning: "continue 2" targeting switch is equivalent to "break 2". Did you mean to use "continue 3"? in %s on line 41 67