crowdstar/ranger

This package is abandoned and no longer maintained. No replacement package was suggested.

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-06-26 06:25:01 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;
}