From: kosugi at kips dot gr dot jp
Operating system: Linux 2.6.18
PHP version: 5.2.8
PHP Bug Type: SPL related
Bug description: ParentIterator Initializing
Description:
------------
ParentIterator that only shows those elements which have children.
But I can't get the expected result without rewind() in starting an
iteration.
Reproduce code:
---------------
$target = array(
'foo' => array(1,2,3),
'bar' => array(11,12,13),
'baz'
);
$rai = new RecursiveArrayIterator($target);
$pi = new ParentIterator($rai);
//$pi->rewind();
while ($pi->valid()) {
var_dump($pi->current());
$pi->next();
}
Expected result:
----------------
array(5) {
[0]=>
int(1)
[1]=>
int(2)
[2]=>
int(3)
}
array(5) {
[0]=>
int(11)
[1]=>
int(12)
[2]=>
int(13)
}
Actual result:
--------------
// no output
--
Edit bug report at http://bugs.php.net/?id=46818&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=46818&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=46818&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=46818&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=46818&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=46818&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=46818&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=46818&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=46818&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=46818&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=46818&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=46818&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=46818&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=46818&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=46818&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46818&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=46818&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=46818&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=46818&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=46818&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=46818&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=46818&r=mysqlcfg