3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! $foo = function () { $bar = (yield "foo"); var_dump($bar); }; $c = $foo(); while ($c->valid()) { var_dump($c->current()); $c->send("bar"); $c->next(); }

preferences:
39.48 ms | 402 KiB | 5 Q