xref: /PHP-8.3/Zend/tests/fibers/throw.phpt (revision c276c16b)
1--TEST--
2Test throwing into fiber
3--FILE--
4<?php
5
6$fiber = new Fiber(function (): void {
7    Fiber::suspend('test');
8});
9
10$value = $fiber->start();
11var_dump($value);
12
13$fiber->throw(new Exception('test'));
14
15?>
16--EXPECTF--
17string(4) "test"
18
19Fatal error: Uncaught Exception: test in %sthrow.php:%d
20Stack trace:
21#0 {main}
22  thrown in %sthrow.php on line %d
23