crowdstar/ranger

Ranger allows you to mimic the range function in PHP as an Iterator, conserving memory for large ranges.

1.0.0 2019-03-21 23:48 UTC

This package is auto-updated.

Last update: 2024-03-26 05:50:10 UTC


README

Build Status

Ranger allows you to mimic the range function in PHP as an Iterator, conserving memory for large ranges.

Installation

composer require crowdstar/ranger:~1.0.0

Sample Usage

Old way

<?php

foreach (range(1, 100000) as $number) {
    echo $number;
}

New way

<?php

use CrowdStar\Iterators\Ranger;

$range = Ranger::start(1, 100000);

foreach ($range as $number) {
	echo $number;
}