3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function gen() { for($i = 1; $i <=3; $i++) { $resp = (yield $i); echo '$resp: '; var_dump($resp); } } $gen = gen(); foreach($gen as $out) { echo '$out: '; var_dump($out); echo $gen->send('Hi ' . $out); }