The word yield means produce or generate which is basically what the keyword does in PHP. It generates a value for use outside your function without entirely stopping its execution and returning. It gives you the ability to pause the execution while you do something else with the returned value. The advantage of using generators is low memory usage.

Table of contents
The Yield Keyword and Generator Functions in PHPAdvantages of Using GeneratorsYielding Values by ReferenceYielding Key-Value PairsGenerator DelegationFinal ThoughtsSort: