3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test() { $test = range(0, 10); foreach ($test as $int) { echo 'before'; yield $int; echo 'after'; } } $test = test(); echo $test->current() . PHP_EOL; $test->next(); echo $test->current() . PHP_EOL;

preferences:
55.2 ms | 402 KiB | 5 Q