|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-04-02 21:54 UTC] felipe@php.net
[2008-04-02 22:05 UTC] felipe@php.net
[2008-04-02 23:12 UTC] felipe@php.net
[2008-05-06 23:15 UTC] colder@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 06:00:02 2025 UTC |
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"