summaryrefslogtreecommitdiff
path: root/ext/spl/tests/iterator_006.phpt
blob: 54da89cbd73d36db45a9fe93c7f6a88b223ef69a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
SPL: IteratorIterator and SimpleXMlElement
--SKIPIF--
<?php if (!extension_loaded('simplexml')) print "skip SimpleXML required"; ?>
--FILE--
<?php

$root = simplexml_load_string(b'<?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===