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