php-src/ext/spl/tests/iterator_006.phpt
2016-11-20 21:11:53 +01:00

25 lines
418 B
PHP

--TEST--
SPL: IteratorIterator and SimpleXMlElement
--SKIPIF--
<?php if (!extension_loaded('simplexml')) print "skip SimpleXML required"; ?>
--FILE--
<?php
$root = simplexml_load_string('<?xml version="1.0"?>
<root>
<child>Hello</child>
<child>World</child>
</root>
');
foreach (new IteratorIterator($root->child) as $child) {
echo $child."\n";
}
?>
===DONE===
<?php exit(0); ?>
--EXPECT--
Hello
World
===DONE===