|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2004-06-17 05:39 UTC] 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? PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 00:00:02 2025 UTC |
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.