xref: /PHP-7.0/ext/spl/tests/bug44615.phpt (revision ee81b5a9)
1--TEST--
2SPL: RecursiveArrayIterator bug 44615
3--CREDITS--
4Julien Pauli <doctorrock83@gmail.com>
5#testfest phpcampparis 2008-06-07
6--FILE--
7<?php
8$a = new stdClass();
9
10$array = array(array('z',$a),array('q','s'));
11
12$rai = new RecursiveArrayIterator($array,RecursiveArrayIterator::CHILD_ARRAYS_ONLY);
13
14foreach (new RecursiveIteratorIterator($rai) as $t) {
15    var_dump($t);
16}
17echo "Second:\n";
18$rai = new RecursiveArrayIterator($array);
19foreach (new RecursiveIteratorIterator($rai) as $t) {
20    var_dump($t);
21}
22?>
23--EXPECTF--
24string(1) "z"
25object(stdClass)#1 (0) {
26}
27string(1) "q"
28string(1) "s"
29Second:
30string(1) "z"
31string(1) "q"
32string(1) "s"
33