mirror of
https://github.com/php/php-src.git
synced 2024-10-22 16:57:05 +00:00
25 lines
393 B
Plaintext
25 lines
393 B
Plaintext
|
--TEST--
|
||
|
SPL: IteratorIterator and SimpleXMlElement
|
||
|
--SKIPIF--
|
||
|
<?php if (!extension_loaded("spl")) print "skip"; ?>
|
||
|
--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===
|