ID: 28813
Updated by: [EMAIL PROTECTED]
Reported By: nospam0 at malkusch dot de
Status: Bogus
Bug Type: Feature/Change Request
Operating System: *
PHP Version: 5.0.0RC3
New Comment:
Most probably from older beta versions where we had
hasMore() instead of valid().
Previous Comments:
------------------------------------------------------------------------
[2004-06-17 15:15:12] nospam0 at malkusch dot de
Yes, when I'm using ReflectionAPI I see that I'm wrong.
I thaught, that an Iterator must have a hasMore()
method...But it is the valid() method. I don't know where
I have that wrong information from.
------------------------------------------------------------------------
[2004-06-17 09:37:33] [EMAIL PROTECTED]
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.
------------------------------------------------------------------------
[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