Re[3]: [PHP-DEV] array_has_more
| From: | (Marcus B�rger) | Date: | Sat, 05 Jul 2003 10:42:19 +0000 |
| Subject: | Re[3]: [PHP-DEV] array_has_more | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-3260@lists.php.net to get a copy of this message | ||
Hello Sascha,
Saturday, July 5, 2003, 6:34:26 AM, you wrote:
>> What you are saying is that differentiating between a null value from
>> next() and not having more elements is impossible without such a function?
>> (I just want to be sure I understand what your motivation is).
>> I don't really have a problem with array_has_more() the only problem is the
>> name is not consistent with the other methods but on the other hand we
>> don't allow new functions which don't follow the naming conventions.
>> Catch-22? :)
SS> The key() can never become false which is why array_has_more
SS> is not needed.
Yes and no. Yes key can't become false. No because array_has_more returns the
information 'has more elements' before accessing them. That is different. It
allows loops where key and element do not have to be cached.
--
Best regards,
Marcus mailto:helly@php.net