3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function printer() { echo "I'm printer!".PHP_EOL; while (true) { $string = yield; echo $string.PHP_EOL; } } $printer = printer(); $printer->send('Hello world!'); $printer->send('Bye world!');
Output for 5.6.38 - 7.3.0rc3
I'm printer! Hello world! Bye world!