xref: /ext-fiber/tests/backtrace-nested.phpt (revision 068e4ea3)
1--TEST--
2Backtrace in nested function call
3--EXTENSIONS--
4fiber
5--FILE--
6<?php
7
8function suspend_fiber(): void
9{
10    \Fiber::suspend();
11    throw new Exception;
12}
13
14$fiber = new Fiber(function (): void {
15    suspend_fiber();
16});
17
18$fiber->start();
19
20$fiber->resume();
21
22?>
23--EXPECTF--
24Fatal error: Uncaught Exception in %sbacktrace-nested.php:%d
25Stack trace:
26#0 %sbacktrace-nested.php(%d): suspend_fiber()
27#1 [internal function]: {closure}()
28#2 %sbacktrace-nested.php(%d): Fiber->resume()
29#3 {main}
30  thrown in %sbacktrace-nested.php on line %d
31