- PDO ODBC driver:
. Fixed data type usage in 64bit. (leocsilva at gmail dot com)
+- SPL extension:
+ . Fixed bug #54971 (Wrong result when using iterator_to_array with use_keys
+ on true). (Pierrick)
16 Jun 2011, PHP 5.3.7 RC1
- Upgraded bundled SQLite to version 3.7.6.3. (Scott)
goto done;
}
+ iter->index = 0;
if (iter->funcs->rewind) {
iter->funcs->rewind(iter TSRMLS_CC);
if (EG(exception)) {
if (apply_func(iter, puser TSRMLS_CC) == ZEND_HASH_APPLY_STOP || EG(exception)) {
goto done;
}
+ iter->index++;
iter->funcs->move_forward(iter TSRMLS_CC);
if (EG(exception)) {
goto done;
--- /dev/null
+--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
+ (
+ )
+
+)