Bug #53119 [NEW]: LimitIterator(ArrayIterator)->seek() doesn't work correctly after OutOfBoundsE
| From: | marc-bennewitz at arcor dot de | Date: | Wed, 20 Oct 2010 18:47:02 +0000 |
| Subject: | Bug #53119 [NEW]: LimitIterator(ArrayIterator)->seek() doesn't work correctly after OutOfBoundsE | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-155380@lists.php.net to get a copy of this message | ||
From:
Operating system: Linux
PHP version: 5.3.3
Package: SPL related
Bug Type: Bug
Bug description:LimitIterator(ArrayIterator)->seek() doesn't work correctly after
OutOfBoundsE
Description:
------------
Seeking after an OutOfBoundException doesn't work without call of rewind.
With php < 5.3 it works as expected.
Test script:
---------------
$it = new ArrayIterator(array('zf9396', 'foo', null));
$it->rewind();
try {
$it->seek(3);
} catch (OutOfBoundsException $e) {
var_dump($it->key());
$it->seek(0);
var_dump($it->key());
}
$lit = new LimitIterator($it, 0, 10);
try {
$lit->seek(3);
} catch (OutOfBoundsException $e) {
var_dump($lit->key());
$lit->seek(0);
var_dump($lit->key());
}
Expected result:
----------------
NULL
int(0)
NULL
int(0)
Actual result:
--------------
NULL
int(0)
NULL
NULL
--
Edit bug report at http://bugs.php.net/bug.php?id=53119&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53119&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53119&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53119&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=53119&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53119&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=53119&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=53119&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=53119&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=53119&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=53119&r=support
Expected behavior: http://bugs.php.net/fix.php?id=53119&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=53119&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=53119&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=53119&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53119&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53119&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=53119&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=53119&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=53119&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=53119&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=53119&r=mysqlcfg