php-src/Zend/tests/fibers/double-start.phpt
Aaron Piotrowski c276c16b66
Implement Fibers
RFC: https://wiki.php.net/rfc/fibers

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

21 lines
390 B
PHP

--TEST--
Start on already running fiber
--FILE--
<?php
$fiber = new Fiber(function (): void {
Fiber::suspend();
});
$fiber->start();
$fiber->start();
?>
--EXPECTF--
Fatal error: Uncaught FiberError: Cannot start a fiber that has already been started in %sdouble-start.php:%d
Stack trace:
#0 %sdouble-start.php(%d): Fiber->start()
#1 {main}
thrown in %sdouble-start.php on line %d