#28813 [Opn->Bgs]: ArrayObject should implement IteratorAggregate
| From: | helly@php.net | Date: | Thu, 17 Jun 2004 07:37:35 +0000 |
| Subject: | #28813 [Opn->Bgs]: ArrayObject should implement IteratorAggregate | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-61020@lists.php.net to get a copy of this message | ||
ID: 28813
Updated by: helly@php.net
Reported By: nospam0 at malkusch dot de
-Status: Open
+Status: Bogus
Bug Type: Feature/Change Request
-Operating System: Linux
+Operating System: *
PHP Version: 5.0.0RC3
New Comment:
1) It does:
php -r 'ReflectionClass::export("ArrayObject");'
Class [ <internal:SPL> <iterateable> class ArrayObject implements
IteratorAggregate, Traversable, ArrayAccess ] {
......
2) The base interface for ALL Iterators is Traversable
3) The iterators all serve different purposes.
4) ArrayIterator has a method valid(), otherwise it couldn't implement
Iterator:
php -r 'ReflectionClass::export("ArrayIterator");'
Class [ <internal:SPL> <iterateable> class ArrayIterator implements
Iterator, Traversable, ArrayAccess, SeekableIterator ] {
.....
Method [ <internal> public method valid ] {
}
.....
=> There is obviously nothing to change.
Next time you file a bug report verify what you propose.
Previous Comments:
------------------------------------------------------------------------
[2004-06-17 05:39:14] nospam0 at malkusch dot de
Description:
------------
It would be very nice, if the ArrayObject would implement
IteratorAggregate. The only thing, which must be done, is
ArrayIterator should implement Iterator, by aliasing
valid() with hasMore().
I think it's to confusing to use so many different
Iterators wich all provides the same functionallity of
Iterator. So why don't they all extend Iterator?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28813&edit=1