Get The GeneratorΒΆ

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

This works with ... and foreach.

../_images/get_the_generator.png