<?php function xrange($start, $limit, $step = 1) { if ($start < $limit) { if ($step <= 0) { throw new LogicException('Step must be +ve'); } for ($i = $start; $i <= $limit; $i += $step) { yield $i; } } else { if ($step >= 0) { throw new LogicException('Step must be -ve'); } for ($i = $start; $i >= $limit; $i += $step) { yield $i; } } } $sum = 0.0; foreach(xrange(1, 1e+6) as $i){ $sum += $i; }
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`