# Generators in PHP

- Thread: https://externals.io/message/62112
- Original archive: https://news-web.php.net/php.internals/62112
- Started by Morgan L. Owens on 2012-08-10T01:01:36+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #62112 — Morgan L. Owens — 2012-08-10T01:01:36+00:00

URL: https://externals.io/message/62112#62112

hakre wrote:

> > […]
 >
 > I love this point a lot. Return is very common and yield is some
 > kind of return.
 >
I agree also: yield behaves far more like a return statement than a 
function call. (In a sense, a yield is a return that doesn't discard the 
current function's execution state.)

Which (as it happens) reminds me of the difference between
return $foo;
and
return ($foo);
