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    while ($foo) {
26        switch ($bar) {
27            case 0:
28                while ($xyz) {
29                    continue 2; // INVALID
30                }
31            case 1:
32                while ($xyz) {
33                    continue 3;
34                }
35            case 2:
36                while ($xyz) {
37                    break 2;
38                }
39        }
40    }
41}
42
43?>
44--EXPECTF--
45Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in %s on line 6
46
47Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in %s on line 14
48
49Warning: "continue 2" targeting switch is equivalent to "break 2". Did you mean to use "continue 3"? in %s on line 26
50