Annotation of embedaddon/php/ext/spl/tests/bug54971.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #54971 (Wrong result when using iterator_to_array with use_keys on true)
3: --SKIPIF--
4: <?php
5: if (!extension_loaded('dom')) die("skip this test needs --enable-dom");
6: ?>
7: --FILE--
8: <?php
9:
10: $source = <<<XML
11: <root>
12: <node>val1</node>
13: <node>val2</node>
14: </root>
15: XML;
16:
17:
18: $doc = new DOMDocument();
19: $doc->loadXML($source);
20:
21: $xpath = new DOMXPath($doc);
22: $items = $xpath->query('//node');
23:
24: print_r(iterator_to_array($items, false));
25: print_r(iterator_to_array($items, true));
26: ?>
27: --EXPECT--
28: Array
29: (
30: [0] => DOMElement Object
31: (
32: )
33:
34: [1] => DOMElement Object
35: (
36: )
37:
38: )
39: Array
40: (
41: [0] => DOMElement Object
42: (
43: )
44:
45: [1] => DOMElement Object
46: (
47: )
48:
49: )
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>