Re: Re: Generators in PHP
| From: | Nikita Popov | Date: | Fri, 27 Jul 2012 17:34:55 +0000 |
| Subject: | Re: Re: Generators in PHP | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-61843@lists.php.net to get a copy of this message | ||
On Wed, Jul 25, 2012 at 10:36 PM, Lester Caine <lester@lsces.co.uk> wrote:
> But WHY would you not simply put the function that is handling the returned
> data in place of the yield?
> Why do you want to keep exiting and re-entering the 'do loop' when the data
> can simply be forwarded direct to a function to handle it?
This question has come up a few times now, i.e. why one can't just use
callbacks. So I added a section about this, explaining it with a few
examples: https://wiki.php.net/rfc/generators#why_not_just_use_callback_functions
Hope it helps,
Nikita