ID: 49556 Updated by: j...@php.net Reported By: adrien dot gibrat at gmail dot com -Status: Open +Status: Bogus Bug Type: SPL related Operating System: * PHP Version: 5.2.10 New Comment:
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. Just add comments to bug #46227 since it's the same issue. Previous Comments: ------------------------------------------------------------------------ [2009-09-14 22:26:05] adrien dot gibrat at gmail dot com Description: ------------ Classes implementig OuterIterator don't point to the first element just after instanciation, unlike the other Iterators. I'm sure this is the same problem that authors of the following bug reports are talking about http://bugs.php.net/bug.php?id=36132 (bogus) http://bugs.php.net/bug.php?id=44063 (bogus) http://bugs.php.net/bug.php?id=47497 (bogus) http://bugs.php.net/bug.php?id=46227 (assigned but nothing appends) The implementations in .inc from ext\spl\internal works as expected... but not the actual C code! Reproduce code: --------------- $a = new ArrayIterator(range('a','z')); var_dump($a->current()); $ii = new IteratorIterator($a); var_dump($ii->current()); $ca = new CachingIterator($a); var_dump($ca->current()); $ai = new AppendIterator($a); var_dump($ai->current()); $ni = new InfiniteIterator($a); var_dump($ni->current()); $li = new LimitIterator($a); var_dump($li->current()); Expected result: ---------------- string(1) "a" string(1) "a" string(1) "a" string(1) "a" string(1) "a" string(1) "a" Actual result: -------------- string(1) "a" NULL NULL NULL NULL NULL ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=49556&edit=1