#30278 [Opn->Csd]: SPL: ArrayIterator: seek($postion) does not work
| From: | helly@php.net | Date: | Wed, 29 Sep 2004 19:43:40 +0000 |
| Subject: | #30278 [Opn->Csd]: SPL: ArrayIterator: seek($postion) does not work | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-66895@lists.php.net to get a copy of this message | ||
ID: 30278
Updated by: helly@php.net
Reported By: d dot peters at gmail dot com
-Status: Open
+Status: Closed
Bug Type: Zend Engine 2 problem
Operating System: *
PHP Version: 5.0.1
Assigned To: helly
New Comment:
Thank you for your bug report. This issue has already been fixed
in the latest released version of PHP, which you can download at
http://www.php.net/downloads.php
Previous Comments:
------------------------------------------------------------------------
[2004-09-29 19:08:24] d dot peters at gmail dot com
Description:
------------
http://www.php.net/~helly/php/ext/spl/classArrayIterator.html#a8
ArrayIterator::seek($position) always jumps to the 2nd element, no
matter which value $position had...
I saw this in changelog:
Fixed bug #27042 (SPL: SeekableIterator seek() broken). (Marcus)
But it was fixed in 5.0.0 Beta4 and I use 5.0.1...
Reproduce code:
---------------
$a = array(0,1,2,3,4,5,6,7,8,9);
$it = new ArrayIterator($a);
$it->rewind();
for ($i=0; $i < $it->count(); $i++)
{
$it->seek($i);
echo $it->current();
}
// output: 0111111111
// -> seek always jumps to the 1st position...
Expected result:
----------------
output: 0123456789
In my opinion it only makes sense to "seek" to the specified
position... but correct my if i'm wrong ;-)
Actual result:
--------------
output: 0111111111
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=30278&edit=1