3v4l.org

run code in 300+ PHP versions simultaneously
<?php $function = function () { yield 0; }; $wrapper = function () use ($function) { $generator = $function(); $generator->valid(); yield from $generator; $generator = $function(); // Comment out this line to get the correct result. $generator->valid(); yield from $generator; }; foreach ($wrapper() as $value) { echo $value; }

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
152.31 ms | 2287 KiB | 8 Q