arrays).
- Added --ri switch to CLI which allows to check extension information. (Marcus)
- Added tidyNode::getParent() method (John, Nuno)
- Fixed zend_llist_remove_tail (Michael Wallner, Dmitry)
+- Fixed bug #40709 (array_reduce() behaves strange with one item stored arrays).
+ (Ilia)
- Fixed bug #40678 (Cross compilation fails). (Tony)
- Fixed bug #40621 (Crash when constructor called inappropriately). (Tony)
- Fixed bug #40609 (Segfaults when using more than one SoapVar in a request).
while (zend_hash_get_current_data_ex(htbl, (void **)&operand, &pos) == SUCCESS) {
if (result) {
zend_fcall_info fci;
-
args[0] = &result;
args[1] = operand;
-
fci.size = sizeof(fci);
fci.function_table = EG(function_table);
fci.function_name = *callback;
zend_hash_move_forward_ex(htbl, &pos);
}
- RETVAL_ZVAL(result, 0, 1);
+ RETVAL_ZVAL(result, 1, 1);
}
/* }}} */
--- /dev/null
+--TEST--
+Bug #40709 (array_reduce() behaves strange with one item stored arrays)
+--SKIPIF--
+--FILE--
+<?php
+function CommaSeperatedList($a, $b) {
+ if($a == null)
+ return $b;
+ else
+ return $a.','.$b;
+}
+
+$arr1 = array(1,2,3);
+$arr2 = array(1);
+
+echo "result for arr1: ".array_reduce($arr1,'CommaSeperatedList')."\n";
+echo "result for arr2: ".array_reduce($arr2,'CommaSeperatedList')."\n";
+echo "result for arr1: ".array_reduce($arr1,'CommaSeperatedList')."\n";
+echo "result for arr2: ".array_reduce($arr2,'CommaSeperatedList')."\n";
+
+echo "Done\n";
+?>
+--EXPECT--
+result for arr1: 1,2,3
+result for arr2: 1
+result for arr1: 1,2,3
+result for arr2: 1
+Done