|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-02-08 17:45 UTC] cataphract@php.net
-Type: Bug
+Type: Documentation Problem
[2011-02-08 17:47 UTC] cataphract@php.net
[2012-04-27 23:20 UTC] salathe@php.net
-Assigned To:
+Assigned To: salathe
[2017-10-24 07:58 UTC] kalle@php.net
-Status: Assigned
+Status: Open
-Assigned To: salathe
+Assigned To:
[2017-10-24 09:13 UTC] salathe@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: salathe
[2017-10-24 09:13 UTC] salathe@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 23:00:01 2025 UTC |
Description: ------------ When you using LimitIterator with offset that is larger or equal than inner iterator collection size and you invoke rewind() on LimitIterator then you get out of bounds exception. You can solve that problem by handle exception from inner iterator's rewind() in LimitIterator::rewind() Test script: --------------- <?php $some_array = array('foo', 'bar'); $iter = new ArrayIterator($some_array); $limitIter = new LimitIterator($iter, 2); foreach($limitIter as $value) { echo $value; } echo 'OK'; ?> Expected result: ---------------- only 'OK' Actual result: -------------- PHP Fatal error: Uncaught exception 'OutOfBoundsException' with message 'Seek position 2 is out of range' in index.php:6 Stack trace: #0 [internal function]: ArrayIterator->seek(2) #1 index.php(6): LimitIterator->rewind() #2 {main}