#49556 [NEW]: OuterIterator(s) don't point to the first element
| From: | adrien dot gibrat at gmail dot com | Date: | Mon, 14 Sep 2009 22:26:05 +0000 |
| Subject: | #49556 [NEW]: OuterIterator(s) don't point to the first element | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-142358@lists.php.net to get a copy of this message | ||
From: adrien dot gibrat at gmail dot com
Operating system:
PHP version: 5.2.10
PHP Bug Type: SPL related
Bug description: OuterIterator(s) don't point to the first element
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 bug report at http://bugs.php.net/?id=49556&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=49556&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=49556&r=trysnapshot53
Try a snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=49556&r=trysnapshot60
Fixed in SVN: http://bugs.php.net/fix.php?id=49556&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49556&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=49556&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=49556&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=49556&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=49556&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=49556&r=support
Expected behavior: http://bugs.php.net/fix.php?id=49556&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=49556&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=49556&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=49556&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=49556&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=49556&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=49556&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=49556&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=49556&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=49556&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=49556&r=mysqlcfg