xref: /PHP-5.6/ext/spl/tests/iterator_006.phpt (revision 610c7fbe)
1--TEST--
2SPL: IteratorIterator and SimpleXMlElement
3--SKIPIF--
4<?php if (!extension_loaded('simplexml')) print "skip SimpleXML required"; ?>
5--FILE--
6<?php
7
8$root = simplexml_load_string(b'<?xml version="1.0"?>
9<root>
10 <child>Hello</child>
11 <child>World</child>
12</root>
13');
14
15foreach (new IteratorIterator($root->child) as $child) {
16	echo $child."\n";
17}
18?>
19===DONE===
20<?php exit(0); ?>
21--EXPECT--
22Hello
23World
24===DONE===
25