Generator
generator has several distinct usages:
- Yield generator: a function or method that uses
yield, implicitly returning an instance of\Generatorand implementing theIteratorinterface without the boilerplate of writing one - Random number generator: an algorithm or function, such as
rand(),mt_rand(), or theRandom\Engineclasses, that produces a sequence of numbers that appears random - Code generator: a tool or library that automates the creation of boilerplate PHP code from templates, configuration, or a schema
Absent further context, generator most often refers to the yield generator.