1--TEST--
2Suspend within nested function call
3--EXTENSIONS--
4fiber
5--FILE--
6<?php
7
8function suspend(): int
9{
10    return Fiber::suspend(1);
11}
12
13$fiber = new Fiber(function (): int {
14    $value = suspend();
15    return Fiber::suspend($value);
16});
17
18var_dump($fiber->start());
19var_dump($fiber->resume(2));
20var_dump($fiber->resume(3));
21var_dump($fiber->getReturn());
22
23echo "done\n";
24
25?>
26--EXPECT--
27int(1)
28int(2)
29NULL
30int(3)
31done
32