empty arrays). Patch by Joel Perras <joel.perras@gmail.com>.
at gmail dot com, Pierre)
- Implemented FR #42060 (Add paged Results support). (ando@OpenLDAP.org,
iarenuno@eteo.mondragon.edu, jeanseb@au-fil-du.net, remy.saissy@gmail.com)
+- Implemented FR #34857 (Change array_combine behaviour when called with empty
+ arrays). (joel.perras@gmail.com)
- Fixed PDO objects binary incompatibility. (Dmitry)
3. Changes made to existing functions
=====================================
--
+- array_combine now returns array() instead of FALSE when two empty arrays are
+ provided as parameters.
===================================
4. Changes made to existing methods
RETURN_FALSE;
}
+ array_init_size(return_value, num_keys);
+
if (!num_keys) {
- php_error_docref(NULL TSRMLS_CC, E_WARNING, "Both parameters should have at least 1 element");
- RETURN_FALSE;
+ return;
}
- array_init_size(return_value, num_keys);
-
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(keys), &pos_keys);
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(values), &pos_values);
while (zend_hash_get_current_data_ex(Z_ARRVAL_P(keys), (void **)&entry_keys, &pos_keys) == SUCCESS &&
*** Testing array_combine() : error conditions specific to array_combine() ***
-- Testing array_combine() function with empty arrays --
-
-Warning: array_combine(): Both parameters should have at least 1 element in %s on line %d
-bool(false)
+array(0) {
+}
-- Testing array_combine() function with empty array for $keys argument --
bool(true)
}
-- Iteration 4 --
-
-Warning: array_combine(): Both parameters should have at least 1 element in %s on line %d
-bool(false)
+array(0) {
+}
-- Iteration 5 --
array(1) {
[""]=>
Warning: Illegal offset type in %s on line %d
-- Iteration 1 --
-
-Warning: array_combine(): Both parameters should have at least 1 element in %s on line %d
-bool(false)
+array(0) {
+}
-- Iteration 2 --
array(1) {
[0]=>
--EXPECTF--
*** Testing array_combine() : assoc array with diff values to both $keys and $values argument ***
-- Iteration 1 --
-
-Warning: array_combine(): Both parameters should have at least 1 element in %s on line %d
-bool(false)
+array(0) {
+}
-- Iteration 2 --
array(1) {
[0]=>