1--TEST--
2Fibers created during cleanup
3--EXTENSIONS--
4fiber
5--FILE--
6<?php
7
8$fibers = [];
9for ($i = 0; $i < 5; $i++) {
10    $fibers[$i] = new Fiber(function() {
11        try {
12            Fiber::suspend();
13        } finally {
14            echo "finally\n";
15            $fiber2 = new Fiber(function() {
16                echo "new\n";
17                try {
18                    Fiber::suspend();
19                } finally {
20                    echo "new finally\n";
21                }
22            });
23            $fiber2->start();
24        }
25    });
26    $fibers[$i]->start();
27}
28
29?>
30--EXPECT--
31finally
32new
33new finally
34finally
35new
36new finally
37finally
38new
39new finally
40finally
41new
42new finally
43finally
44new
45new finally
46