1--TEST--
2Observer: Throwing fiber
3--EXTENSIONS--
4zend_test
5--INI--
6zend_test.observer.enabled=1
7zend_test.observer.show_output=1
8zend_test.observer.fiber_switch=1
9--FILE--
10<?php
11
12$fiber = new Fiber(function (): void {
13    Fiber::suspend();
14});
15
16$fiber->start();
17
18try {
19    $fiber->throw(new Exception);
20} catch (Exception $exception) {
21
22}
23
24?>
25--EXPECTF--
26<!-- init '%s' -->
27<!-- init Fiber::__construct() -->
28<!-- init Fiber::start() -->
29<!-- switching from fiber %s to %s -->
30<init '%s'>
31<!-- init {closure}() -->
32<!-- init Fiber::suspend() -->
33<!-- switching from fiber %s to %s -->
34<suspend '%s'>
35<!-- init Exception::__construct() -->
36<!-- init Fiber::throw() -->
37<!-- switching from fiber %s to %s -->
38<resume '%s'>
39<!-- switching from fiber %s to %s -->
40<threw '%s'>
41