xref: /PHP-8.1/Zend/tests/fibers/catch.phpt (revision c276c16b)
1--TEST--
2Catch exception thrown into fiber
3--FILE--
4<?php
5
6$fiber = new Fiber(function () {
7    try {
8        Fiber::suspend('test');
9    } catch (Exception $exception) {
10        var_dump($exception->getMessage());
11    }
12});
13
14$value = $fiber->start();
15var_dump($value);
16
17$fiber->throw(new Exception('test'));
18
19?>
20--EXPECT--
21string(4) "test"
22string(4) "test"
23