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