Re: Generators in PHP
| From: | Anthony Ferrara | Date: | Wed, 06 Jun 2012 23:37:42 +0000 |
| Subject: | Re: Generators in PHP | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-60770@lists.php.net to get a copy of this message | ||
Nikita,
> I don't know whether that behavior is of any use, so I'll gladly
> change the behavior to throwing an exception if that's more desirable.
You can't throw an exception from rewind, since it's called before
foreach(). So it wouldn't be iterable then.
I think the noop on rewind is valid in this context, as long as it's
documented...
Anthony