3v4l.org

run code in 300+ PHP versions simultaneously
<?php function printer() { $i=true; $times=1; while ($i) { $string = yield; yield $string; $times++; $i=false; } var_dump($i,$times); } $printer = printer(); $printer->send('Hello world!'); echo $printer->current(); ?>

preferences:
38.49 ms | 402 KiB | 5 Q