We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a0e68a1 commit 1118e22Copy full SHA for 1118e22
Zend/tests/match/020.phpt
@@ -0,0 +1,39 @@
1
+--TEST--
2
+Test breaking out of match arm with continue
3
+--FILE--
4
+<?php
5
+
6
+foreach (range(0, 9) as $i) {
7
+ match ($i) {
8
+ default => {
9
+ echo "$i 1\n";
10
+ continue;
11
+ echo "$i 2\n";
12
+ },
13
+ }
14
15
+ echo "$i 3\n";
16
+}
17
18
+--EXPECTF--
19
+Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in %s on line %d
20
+0 1
21
+0 3
22
+1 1
23
+1 3
24
+2 1
25
+2 3
26
+3 1
27
+3 3
28
+4 1
29
+4 3
30
+5 1
31
+5 3
32
+6 1
33
+6 3
34
+7 1
35
+7 3
36
+8 1
37
+8 3
38
+9 1
39
+9 3
0 commit comments