Get The Generator

../_images/get_the_generator.png

It is possible to catch a generator when it is called, by putting it in a variable. Once the generator has been used, it is possible to call a method such as getReturn on it.

This works with ... and foreach.

See Also

PHP Features