也许这有助于您理解 start-suspend-resume-return 的循环
$fiber = new Fiber(
function($one) {
$two = Fiber::suspend($one);
$three = Fiber::suspend($two);
$four = Fiber::suspend($three);
$five = Fiber::suspend($four);
$six = Fiber::suspend($five);
return $six;
}
);
print $fiber->start(1);
print $fiber->resume(2);
print $fiber->resume(3);
print $fiber->resume(4);
print $fiber->resume(5);
print $fiber->resume(6);
print $fiber->getReturn();
// 输出 123456