1--TEST--
2Cannot start fiber within destructor
3--FILE--
4<?php
5
6return new class () {
7    public function __destruct() {
8        $fiber = new Fiber(fn () => null);
9        $fiber->start();
10    }
11};
12
13?>
14--EXPECTF--
15Fatal error: Uncaught FiberError: Cannot switch fibers in current execution context in %sno-switch-dtor-start.php:%d
16Stack trace:
17#0 %sno-switch-dtor-start.php(%d): Fiber->start()
18#1 %sno-switch-dtor-start.php(%d): class@anonymous->__destruct()
19#2 {main}
20  thrown in %sno-switch-dtor-start.php on line %d
21