1--TEST--
2Test unfinished fiber with nested try/catch blocks
3--FILE--
4<?php
5
6$fiber = new Fiber(function (): void {
7    try {
8        try {
9            try {
10                echo "fiber\n";
11                echo Fiber::suspend();
12                echo "after await\n";
13            } catch (Throwable $exception) {
14                echo "inner exit exception caught!\n";
15            }
16        } catch (Throwable $exception) {
17            echo "exit exception caught!\n";
18        } finally {
19            echo "inner finally\n";
20        }
21    } finally {
22        echo "outer finally\n";
23    }
24
25    echo "unreached\n";
26
27    try {
28        echo Fiber::suspend();
29    } finally {
30        echo "unreached\n";
31    }
32
33    echo "end of fiber should not be reached\n";
34});
35
36$fiber->start();
37
38unset($fiber); // Destroy fiber object, executing finally block.
39
40echo "done\n";
41
42?>
43--EXPECT--
44fiber
45inner finally
46outer finally
47done
48