Re: Re: Generators in PHP
| From: | Sherif Ramadan | Date: | Fri, 27 Jul 2012 13:27:05 +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-61839@lists.php.net to get a copy of this message | ||
>
>
> Nikita - I am looking for a well reasoned argument as to why generator has
> to be added at all! 'Just because it can be' is not a valid argument, but
> perhaps you could add to the RFC the performance implication or advantage of
> what is being proposed. That would at least be some comparison with the
> current methods of doing the same thing?
>
>
If you read the RFC you will see all of these issues are already
addressed there.
https://wiki.php.net/rfc/generators#performance
"You can find a small micro benchmark at
https://gist.github.com/2975796. It compares several
ways of iterating
ranges:"
What part of this discussion led you to believe such a ridiculous
argument as to why generator were introduced? I'm glad to see that
while seeking reason you are also demonstrating it.