yieldkeyword is used by generators, which provide a simple way to implement iterators without having to create a class that implements the
Iteratorinterface. A generator allows you to write code that iterates over a set of data without needing to build an array in memory that is returned at the end.
Every two weeks I send out a newsletter containing lots of interesting stuff for the modern PHP developer. You can expect quick tips, links to interesting tutorials, opinions and packages. Want to learn the cool stuff? Then sign up now!