1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 16:38:25 +02:00
Files
archived-php-src/ext/spl/tests/bug54971.phpt
T

46 lines
611 B
PHP

--TEST--
Bug #54971 (Wrong result when using iterator_to_array with use_keys on true)
--FILE--
<?php
$source = <<<XML
<root>
<node>val1</node>
<node>val2</node>
</root>
XML;
$doc = new DOMDocument();
$doc->loadXML($source);
$xpath = new DOMXPath($doc);
$items = $xpath->query('//node');
print_r(iterator_to_array($items, false));
print_r(iterator_to_array($items, true));
?>
--EXPECT--
Array
(
[0] => DOMElement Object
(
)
[1] => DOMElement Object
(
)
)
Array
(
[0] => DOMElement Object
(
)
[1] => DOMElement Object
(
)
)