Example PHP generator
For now it's just a simple example of PHP iterator, let's see if it will grow up into something more fun.
This files intended to run as a CLI scripts:
php ./iterator1.php
php ./iterator2.php
php ./iterator3.php
php ./iterator4.php
There are four examples:
- Basic iterator based on \Iterator using PHP array functions: current(), next(), key(), reset().
- Basic iterator based on \Iterator using class property $key.
- Basic iterator based on \IteratorAggregate and \ArrayIterator.
- Basic iterator based on \IteratorAggregate and \ArrayIterator and abstract Collection class.