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