Re: Iterator Class/foreach Logic Flaw?
| From: | Andrei Zmievski | Date: | Thu, 26 Feb 2004 20:44:40 +0000 |
| Subject: | Re: Iterator Class/foreach Logic Flaw? | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-8185@lists.php.net to get a copy of this message | ||
On Thu, 26 Feb 2004, Philip Fletcher wrote:
> Thanks Marcus
>
> Looking at the documentation, the comments and method name (for hasMore())
> do not have the same meaning - the comment is saying 'does the current
> element exist?' and the method name says 'are there any more elements?'.
>
> This makes the api very ambiguous - hasMore() and isValid() have very
> specific meaning in many languages wrt iterators.
I agree. The semantics are fairly different. Let's not confuse them.
-Andrei
"This isn't right. This isn't even wrong."
-- Wolfgang Pauli