|
|
|
@ -1316,7 +1316,6 @@ PHP_FUNCTION(min) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ZVAL_DEREF(min); |
|
|
|
ZVAL_COPY(return_value, min); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -1363,7 +1362,6 @@ PHP_FUNCTION(max) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
ZVAL_DEREF(max); |
|
|
|
ZVAL_COPY(return_value, max); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -3812,7 +3810,6 @@ static inline void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETE |
|
|
|
for (i = 0; i < argc; i++) { |
|
|
|
zval *arg = args + i; |
|
|
|
|
|
|
|
ZVAL_DEREF(arg); |
|
|
|
if (Z_TYPE_P(arg) != IS_ARRAY) { |
|
|
|
php_error_docref(NULL, E_WARNING, "Argument #%d is not an array", i + 1); |
|
|
|
RETURN_NULL(); |
|
|
|
@ -3825,19 +3822,16 @@ static inline void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETE |
|
|
|
|
|
|
|
/* copy first array */ |
|
|
|
arg = args; |
|
|
|
ZVAL_DEREF(arg); |
|
|
|
dest = zend_array_dup(Z_ARRVAL_P(arg)); |
|
|
|
ZVAL_ARR(return_value, dest); |
|
|
|
if (recursive) { |
|
|
|
for (i = 1; i < argc; i++) { |
|
|
|
arg = args + i; |
|
|
|
ZVAL_DEREF(arg); |
|
|
|
php_array_replace_recursive(dest, Z_ARRVAL_P(arg)); |
|
|
|
} |
|
|
|
} else { |
|
|
|
for (i = 1; i < argc; i++) { |
|
|
|
arg = args + i; |
|
|
|
ZVAL_DEREF(arg); |
|
|
|
zend_hash_merge(dest, Z_ARRVAL_P(arg), zval_add_ref, 1); |
|
|
|
} |
|
|
|
} |
|
|
|
@ -3846,7 +3840,6 @@ static inline void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETE |
|
|
|
HashTable *src, *dest; |
|
|
|
|
|
|
|
arg = args; |
|
|
|
ZVAL_DEREF(arg); |
|
|
|
src = Z_ARRVAL_P(arg); |
|
|
|
/* copy first array */ |
|
|
|
array_init_size(return_value, zend_hash_num_elements(src)); |
|
|
|
@ -3881,13 +3874,11 @@ static inline void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETE |
|
|
|
if (recursive) { |
|
|
|
for (i = 1; i < argc; i++) { |
|
|
|
arg = args + i; |
|
|
|
ZVAL_DEREF(arg); |
|
|
|
php_array_merge_recursive(dest, Z_ARRVAL_P(arg)); |
|
|
|
} |
|
|
|
} else { |
|
|
|
for (i = 1; i < argc; i++) { |
|
|
|
arg = args + i; |
|
|
|
ZVAL_DEREF(arg); |
|
|
|
php_array_merge(dest, Z_ARRVAL_P(arg)); |
|
|
|
} |
|
|
|
} |
|
|
|
|