3v4l.org

run code in 300+ PHP versions simultaneously
<?php function xrange($start, $limit, $step = 1) { if ($start < $limit) { echo 'yep';die; if ($step <= 0) { throw new LogicException('Step must be +ve'); } echo $step; for ($i = $start; $i <= $limit; $i += $step) { yield $i; echo 'iter' . $i; } } } echo 'Single digit odd numbers from range(): ' . PHP_EOL; foreach (range(1, 9, -5) as $number) { echo $number . PHP_EOL; }

preferences:
40.23 ms | 402 KiB | 5 Q