1
0
mirror of https://github.com/php/php-src.git synced 2026-04-20 22:41:20 +02:00
Files
archived-php-src/Zend/tests/fibers/throw.phpt
Aaron Piotrowski c276c16b66 Implement Fibers
RFC: https://wiki.php.net/rfc/fibers

Closes GH-6875.
2021-04-26 11:07:06 -05:00

23 lines
353 B
PHP

--TEST--
Test throwing into fiber
--FILE--
<?php
$fiber = new Fiber(function (): void {
Fiber::suspend('test');
});
$value = $fiber->start();
var_dump($value);
$fiber->throw(new Exception('test'));
?>
--EXPECTF--
string(4) "test"
Fatal error: Uncaught Exception: test in %sthrow.php:%d
Stack trace:
#0 {main}
thrown in %sthrow.php on line %d