1--TEST--
2Fiber interaction with custom fiber implementation 5
3--EXTENSIONS--
4zend_test
5--FILE--
6<?php
7$test = new _ZendTestFiber(function (): void {
8    $fiber = new Fiber(function (): int {
9        $value = Fiber::suspend(1);
10        var_dump($value); // int(2)
11        $value = _ZendTestFiber::suspend(3);
12        var_dump($value); // int(6)
13        $value = Fiber::suspend(4);
14        var_dump($value); // int(8)
15        return 2 * $value;
16    });
17    $value = $fiber->start();
18    var_dump($value); // int(1)
19    $value = $fiber->resume(2 * $value);
20    var_dump($value); // int(4)
21    $value = $fiber->resume(2 * $value);
22    var_dump($value); // NULL
23    var_dump($fiber->getReturn()); // int(16)
24});
25$value = $test->start();
26var_dump($value); // int(3)
27$value = $test->resume(2 * $value);
28
29?>
30--EXPECT--
31int(1)
32int(2)
33int(3)
34int(6)
35int(4)
36int(8)
37NULL
38int(16)
39