1--TEST--
2Observer: Basic function observing in fibers
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$fiber->resume();
23
24?>
25--EXPECTF--
26<!-- init '%s' -->
27<file '%s'>
28  <!-- init Fiber::__construct() -->
29  <Fiber::__construct>
30  </Fiber::__construct>
31  <!-- init Fiber::start() -->
32  <Fiber::start>
33<!-- alloc: %s -->
34<!-- switching from fiber %s to %s -->
35<init '%s'>
36    <!-- init {closure:%s:%d}() -->
37    <{closure:%s:%d}>
38      <!-- init var_dump() -->
39      <var_dump>
40int(1)
41      </var_dump>
42      <!-- init Fiber::suspend() -->
43      <Fiber::suspend>
44<!-- switching from fiber %s to %s -->
45<suspend '%s'>
46      </Fiber::start>
47      <!-- init Fiber::resume() -->
48      <Fiber::resume>
49<!-- switching from fiber %s to %s -->
50<resume '%s'>
51      </Fiber::suspend>
52      <var_dump>
53int(2)
54      </var_dump>
55    </{closure:%s:%d}>
56<!-- switching from fiber %s to %s -->
57<returned '%s'>
58<!-- destroy: %s -->
59  </Fiber::resume>
60</file '%s'>
61