summaryrefslogtreecommitdiff
path: root/ext/standard/array.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/array.c')
-rw-r--r--ext/standard/array.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/standard/array.c b/ext/standard/array.c
index 99b9e78c31..ee3c5ae75a 100644
--- a/ext/standard/array.c
+++ b/ext/standard/array.c
@@ -4481,13 +4481,12 @@ PHP_FUNCTION(array_combine)
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 &&