xref: /PHP-8.1/Zend/tests/jump05.phpt (revision f8d79582)
1--TEST--
2jump 05: goto from loop (forward)
3--FILE--
4<?php
5$ar = array("1","2","3");
6foreach ($ar as $val) {
7    switch ($val) {
8        case "1":
9            echo "1: ok\n";
10            break;
11        case "2":
12            echo "2: ok\n";
13            goto L1;
14        case "3":
15            echo "bug\n";
16            break;
17    }
18}
19echo "bug\n";
20L1:
21echo "3: ok\n";
22?>
23--EXPECT--
241: ok
252: ok
263: ok
27