xref: /PHP-7.4/Zend/tests/try/try_finally_014.phpt (revision 74380105)
1--TEST--
2Break 2 in try and return in finally inside nested loop
3--FILE--
4<?php
5
6function foo() {
7    $array = [1, 2, $n = 3];
8    foreach ($array as $value) {
9        foreach ($array as $value) {
10            try {
11                echo "try\n";
12                break 2;
13            } finally {
14                echo "finally\n";
15                return;
16            }
17        }
18    }
19}
20
21foo();
22?>
23===DONE===
24--EXPECT--
25try
26finally
27===DONE===
28