- range: documentation ( source)
<?php
function xrange($start, $limit, $step = 1) {
throw new LogicException('No no no no');
for ($i = $start; $i <= $limit; $i += $step) {
yield $i;
}
}
foreach (range(1, 9, 1) as $number) {
echo $number . PHP_EOL;
}