Hi,
Could you please, take a look into the PoC. It's incomplete, but may be you get ideas how to fix this. https://gist.github.com/dstogov/285024375d15cacf2a9b Few tests are failed, because YIELD may be used as expression in nested calls (between INIT_FCALL/DO_FCALL), and the caller function restores EG(vm_stack_top), loosing and overwriting that active frame. <?php function gen() { var_dump(yield 1); } for ($gen = gen(); $gen->valid(); $gen->send(0)) { var_dump($gen->current()); } ?> Thanks. Dmitry.