PHP : rfc:generators [PHP Wiki]
►https://wiki.php.net/rfc/generators
Generators provide an easy, boilerplate-free way of implementing iterators. As an example, consider how you would implement the file() function in userland code: function getLinesFromFile($fileName) {…
Source: PHP: start [PHP Wiki]