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