1--TEST--
2ReflectionFiber backtrace test
3--FILE--
4<?php
5
6function suspend_fiber(): void {
7    Fiber::suspend();
8}
9
10class Test
11{
12    public function __invoke(string $arg): void
13    {
14        suspend_fiber();
15    }
16}
17
18$fiber = new Fiber(new Test);
19
20$fiber->start('test');
21
22$reflection = new ReflectionFiber($fiber);
23
24var_dump($reflection->getTrace(DEBUG_BACKTRACE_PROVIDE_OBJECT));
25
26?>
27--EXPECTF--
28array(3) {
29  [0]=>
30  array(6) {
31    ["file"]=>
32    string(%d) "%sReflectionFiber_backtrace.php"
33    ["line"]=>
34    int(4)
35    ["function"]=>
36    string(7) "suspend"
37    ["class"]=>
38    string(5) "Fiber"
39    ["type"]=>
40    string(2) "::"
41    ["args"]=>
42    array(0) {
43    }
44  }
45  [1]=>
46  array(4) {
47    ["file"]=>
48    string(%d) "%sReflectionFiber_backtrace.php"
49    ["line"]=>
50    int(11)
51    ["function"]=>
52    string(13) "suspend_fiber"
53    ["args"]=>
54    array(0) {
55    }
56  }
57  [2]=>
58  array(5) {
59    ["function"]=>
60    string(8) "__invoke"
61    ["class"]=>
62    string(4) "Test"
63    ["object"]=>
64    object(Test)#2 (0) {
65    }
66    ["type"]=>
67    string(2) "->"
68    ["args"]=>
69    array(1) {
70      [0]=>
71      string(4) "test"
72    }
73  }
74}
75