- range: documentation ( source)
<?php
// Everything you enter here will be executed by our servers. Try it!
$array = range(1, 10000);
foreach (xrange() as $a) {
echo "$a\n";
}
function xrange () {
for ($i = 0; $i <= 1000; $i++) {
yield $i;
}
}