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
Requires
- php: >=5.3
Requires (Dev)
- phpunit/phpunit: >=4.8
- squizlabs/php_codesniffer: >=2.0
This package is auto-updated.
Last update: 2024-03-26 05:50:10 UTC
README
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; }