From: doctorrock83 at gmail dot com Operating system: Windows XP PHP version: 5.2.5 PHP Bug Type: SPL related Bug description: RecursiveArrayIterator doesnt handle correctly objects stored in it
Description: ------------ RecursiveArrayIterator doesn't seem to handle objects stored in it correctly. If you store anything else into the RecursiveArrayIterator (ie : strings, integers, or even ressources ), they are served back from the iterator. But if you store an object of any class into it, then it disappears while iterating. PS : Perhaps a RecursiveIteratorIterator bug, dunnow :-) Reproduce code: --------------- <?php $a = new stdClass(); $array = array(array('z',$a),array('q','s')); $rai = new RecursiveArrayIterator($array); foreach (new RecursiveIteratorIterator($rai) as $t) { var_dump($t); } Expected result: ---------------- string(1) "z" object(stdClass)#1 (0) { } string(1) "q" string(1) "s" Actual result: -------------- string(1) "z" string(1) "q" string(1) "s" -- Edit bug report at http://bugs.php.net/?id=44615&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44615&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44615&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44615&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44615&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44615&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44615&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44615&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44615&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44615&r=support Expected behavior: http://bugs.php.net/fix.php?id=44615&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44615&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44615&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44615&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44615&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44615&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44615&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44615&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44615&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44615&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44615&r=mysqlcfg