1--TEST--
2Observer: Nested fibers with both unfinished
3--EXTENSIONS--
4zend_test
5--INI--
6zend_test.observer.enabled=1
7zend_test.observer.show_output=1
8zend_test.observer.fiber_switch=1
9--FILE--
10<?php
11
12$fiber = new Fiber(function (): void {
13    Fiber::suspend();
14
15    $fiber = new Fiber(function (): void {
16        Fiber::suspend();
17    });
18
19    $fiber->start();
20
21    Fiber::suspend();
22});
23
24$fiber->start();
25$fiber->resume();
26
27?>
28--EXPECTF--
29<!-- init '%s' -->
30<!-- init Fiber::__construct() -->
31<!-- init Fiber::start() -->
32<!-- switching from fiber %s to %s -->
33<init '%s'>
34<!-- init {closure}() -->
35<!-- init Fiber::suspend() -->
36<!-- switching from fiber %s to %s -->
37<suspend '%s'>
38<!-- init Fiber::resume() -->
39<!-- switching from fiber %s to %s -->
40<resume '%s'>
41<!-- switching from fiber %s to %s -->
42<init '%s'>
43<!-- init {closure}() -->
44<!-- switching from fiber %s to %s -->
45<suspend '%s'>
46<!-- switching from fiber %s to %s -->
47<suspend '%s'>
48<!-- switching from fiber %s to %s -->
49<destroying '%s'>
50<!-- switching from fiber %s to %s -->
51<destroying '%s'>
52<!-- switching from fiber %s to %s -->
53<destroyed '%s'>
54<!-- switching from fiber %s to %s -->
55<destroyed '%s'>
56