|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-02-24 16:34 UTC] doctorrock83 at gmail dot com
[2009-05-04 10:05 UTC] johannes@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 02:00:01 2025 UTC |
Description: ------------ CachingIterator doesn't work if its innerIterator is an instance of IteratorIterator. The use-case provided here might seem strange as the IteratorIterator is not necessary. However, it would become necessary for a use case dealing with a Traversable class such as PDOStatement, and the bug stays the same. Additionnaly, we actually have to call next() manually but it should be called internaly. This leads to another bug which has already been reported at #46227 Reproduce code: --------------- $it = new ArrayIterator(range('a','z'); $cache = new CachingIterator(new IteratorIterator($it)); $cache->next(); var_dump($cache->current()); var_dump($cache->hasNext()); Expected result: ---------------- 1 and TRUE Actual result: -------------- NULL and FALSE