xref: /ext-fiber/tests/double-start.phpt (revision 068e4ea3)
1--TEST--
2Start on already running fiber
3--EXTENSIONS--
4fiber
5--FILE--
6<?php
7
8$fiber = new Fiber(function (): void {
9    Fiber::suspend();
10});
11
12$fiber->start();
13
14$fiber->start();
15
16?>
17--EXPECTF--
18Fatal error: Uncaught FiberError: Cannot start a fiber that has already been started in %sdouble-start.php:%d
19Stack trace:
20#0 %sdouble-start.php(%d): Fiber->start()
21#1 {main}
22  thrown in %sdouble-start.php on line %d
23