xref: /PHP-8.0/Zend/tests/bug72188.phpt (revision be071702)
1--TEST--
2Bug #72188 (Nested try/finally blocks losing return value)
3--FILE--
4<?php
5function test() {
6    try {
7        return 5;
8    } finally {
9        try {
10            echo 1;
11        } finally {
12            echo 2;
13        }
14    }
15}
16
17
18
19$a = test();
20if($a !== 5) {
21    echo "FAILED: expected 5, received ", var_export($a), PHP_EOL;
22} else {
23    echo "Passed", PHP_EOL;
24}
25?>
26--EXPECT--
2712Passed
28