or iterator, that can be iterated itself internally. so; arrays, generators and \Traversable foreach ($iterator as $key => $value) {} CC BY-NC 4.0 Justin Yost 3
Generators can be interrupted in processing via yield — return ends a generator — You can operate a Generator using Iterator current, next, key methods — Except for rewind, Generators are forward only Iterators CC BY-NC 4.0 Justin Yost 14
by passing the input — then yields the return value of the generator — current just yields the return value of the generator CC BY-NC 4.0 Justin Yost 25
executes the generator by passing the input — then yields the return value of the generator — current just yields the return value of the generator — each yield means we have another exit depending on where in the iteration we are — each iteration - first yield then second, then loop, repeat CC BY-NC 4.0 Justin Yost 27