File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
spl /
tests /
bug54971.phpt
Revision
1.1.1.2 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue May 29 12:34:43 2012 UTC (12 years, 2 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
HEAD
php 5.4.3+patches
--TEST--
Bug #54971 (Wrong result when using iterator_to_array with use_keys on true)
--SKIPIF--
<?php
if (!extension_loaded('dom')) die("skip this test needs --enable-dom");
?>
--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(array_map('get_class', iterator_to_array($items, false)));
print_r(array_map('get_class', iterator_to_array($items, true)));
?>
--EXPECT--
Array
(
[0] => DOMElement
[1] => DOMElement
)
Array
(
[0] => DOMElement
[1] => DOMElement
)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>