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('<?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