Re: Re: Iterator Class/foreach Logic Flaw? (was: [PHP-DEV] Cannot use foreach() with $this->my
| From: | Philip Fletcher | Date: | Tue, 02 Mar 2004 21:35:55 +0000 |
| Subject: | Re: Re: Iterator Class/foreach Logic Flaw? (was: [PHP-DEV] Cannot use foreach() with $this->my | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-8324@lists.php.net to get a copy of this message | ||
>
> You mean that the hasMore is being used just to
> assure the current position is valid. While it should
> be only used to confirm if there are more elements or
> not. Right?
>
Absolutely. To avoid lots of confusion/bug reports, the current hasMore()
should be renamed to isValid().
Philip