Download the PHP package bentools/rewindable-generator without Composer
On this page you can find all versions of the php package bentools/rewindable-generator. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download bentools/rewindable-generator
More information about bentools/rewindable-generator
Files in bentools/rewindable-generator
Download bentools/rewindable-generator
More information about bentools/rewindable-generator
Files in bentools/rewindable-generator
Vendor bentools
Package rewindable-generator
Short Description Now your generators become rewindable.
License MIT
Package rewindable-generator
Short Description Now your generators become rewindable.
License MIT
Please rate this library. Is it a good library?
Informations about the package rewindable-generator
Rewindable generator
PHP Fatal error: Uncaught Exception: Cannot traverse an already closed generator
Yes, I know. That's annoying. But here's a tiny class which will leverage a CachingIterator
to make your generator rewindable.
Simple as:
Warning: An exception will be thrown if you intend to rewind a generator which has not reached the end (i.e you break
the loop), since the CachingIterator
won't have all items in cache.
Installation
composer require bentools/rewindable-generator
Tests
./vendor/bin/phpunit
All versions of rewindable-generator with dependencies
PHP Build Version
Package Version
Requires
php Version
>=8.1
The package bentools/rewindable-generator contains the following files
Loading the files please wait ....