backtrace-nested.phpt 520 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. Backtrace in nested function call
  3. --FILE--
  4. <?php
  5. function suspend_fiber(): void
  6. {
  7. \Fiber::suspend();
  8. throw new Exception;
  9. }
  10. $fiber = new Fiber(function (): void {
  11. suspend_fiber();
  12. });
  13. $fiber->start();
  14. $fiber->resume();
  15. ?>
  16. --EXPECTF--
  17. Fatal error: Uncaught Exception in %sbacktrace-nested.php:%d
  18. Stack trace:
  19. #0 %sbacktrace-nested.php(%d): suspend_fiber()
  20. #1 [internal function]: {closure}()
  21. #2 %sbacktrace-nested.php(%d): Fiber->resume()
  22. #3 {main}
  23. thrown in %sbacktrace-nested.php on line %d