xref: /PHP-8.3/Zend/tests/bug70012.phpt (revision f8d79582)
1--TEST--
2Bug #70012 (Exception lost with nested finally block)
3--FILE--
4<?php
5try {
6    echo "Outer try\n";
7    try {
8        echo "  Middle try\n";
9        throw new Exception();
10    } finally {
11        echo "  Middle finally\n";
12        try {
13            echo "    Inner try\n";
14        } finally {
15            echo "    Inner finally\n";
16        }
17    }
18    echo "Outer shouldn't get here\n";
19} catch (Exception $e) {
20    echo "Outer catch\n";
21} finally {
22    echo "Outer finally\n";
23}
24?>
25--EXPECT--
26Outer try
27  Middle try
28  Middle finally
29    Inner try
30    Inner finally
31Outer catch
32Outer finally
33