Skip to content

Commit 09688b2

Browse files
committed
Add test for suspend after throw
1 parent 4df21bb commit 09688b2

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--TEST--
2+
Catch exception thrown into fiber, then suspend again
3+
--FILE--
4+
<?php
5+
6+
$fiber = new Fiber(function () {
7+
try {
8+
Fiber::suspend('in try');
9+
} catch (Exception $exception) {
10+
}
11+
12+
Fiber::suspend('after catch');
13+
});
14+
15+
var_dump($fiber->start());
16+
17+
var_dump($fiber->throw(new Exception));
18+
19+
var_dump($fiber->resume());
20+
21+
?>
22+
--EXPECT--
23+
string(6) "in try"
24+
string(11) "after catch"
25+
NULL

0 commit comments

Comments
 (0)