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 1118e22 commit 69a826cCopy full SHA for 69a826c
Zend/tests/match/021.phpt
@@ -0,0 +1,16 @@
1
+--TEST--
2
+Test compilation error trying to goto into a match expression
3
+--FILE--
4
+<?php
5
+
6
+goto match_expression_false_arm;
7
8
+match (true) {
9
+ false => {
10
+ match_expression_false_arm:
11
+ echo 'Should not work';
12
+ }
13
+}
14
15
+--EXPECTF--
16
+Fatal error: 'goto' into loop or switch statement is disallowed in %s on line %d
Zend/tests/match/022.phpt
@@ -0,0 +1,17 @@
+Test jumping out of match arm using goto
+ true => {
+ goto after_match_expression;
+ echo "Never executed\n";
+after_match_expression:
+echo "After match expression";
+--EXPECT--
17
+After match expression
0 commit comments