1--TEST--
2Fiber::getReturn() after a fiber throws
3--FILE--
4<?php
5
6$fiber = new Fiber(fn() => throw new Exception('test'));
7
8try {
9    $fiber->start();
10} catch (Exception $exception) {
11    echo $exception->getMessage(), "\n";
12}
13
14$fiber->getReturn();
15
16?>
17--EXPECTF--
18test
19
20Fatal error: Uncaught FiberError: Cannot get fiber return value: The fiber threw an exception in %sget-return-after-throwing.php:%d
21Stack trace:
22#0 %sget-return-after-throwing.php(%d): Fiber->getReturn()
23#1 {main}
24  thrown in %sget-return-after-throwing.php on line %d
25