<?php
class It implements IteratorAggregate
{
public function getIterator(): Generator
{
yield "";
Fiber::suspend();
}
}
function g()
{
yield from new It();
}
function gen($gen)
{
yield from $gen;
}
$a = g();
$b = gen($a);
$fiber = new Fiber(function () use ($b) {
$b->next();
});
$fiber->start();
while ($a->valid()) {
$a->next();
}
Segmentation fault (core dumped)