Fix arginfo for array_replace(_recursive) and array_merge(_recursive)
authorGabriel Caruso <carusogabriel34@gmail.com>
Sun, 25 Mar 2018 17:53:57 +0000 (14:53 -0300)
committerChristoph M. Becker <cmbecker69@gmx.de>
Fri, 13 Apr 2018 13:27:16 +0000 (15:27 +0200)
NEWS
ext/standard/array.c
ext/standard/basic_functions.c

diff --git a/NEWS b/NEWS
index 2b84a826e59b85b257b78ad53197117b06e119d6..bb5223287f47a653e56a7e8b5538ba94756d77d1 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? ????, PHP 7.1.18
 
+- Reflection:
+  . Fixed arginfo for array_replace(_recursive) and array_merge(_recursive).
+    (carusogabriel)
 
 
 26 Apr 2018, PHP 7.1.17
index 07db3754407da781044f6605ff72629379cd27f5..970735cf47c6702ceda32cb2c43b187405d8a9a2 100644 (file)
@@ -2788,7 +2788,7 @@ PHP_FUNCTION(array_unshift)
        Z_ARRVAL_P(stack)->nNextFreeElement  = new_hash.nNextFreeElement;
        Z_ARRVAL_P(stack)->arData            = new_hash.arData;
        Z_ARRVAL_P(stack)->pDestructor       = new_hash.pDestructor;
-       
+
        zend_hash_internal_pointer_reset(Z_ARRVAL_P(stack));
 
        /* Clean up and return the number of elements in the stack */
@@ -3229,7 +3229,7 @@ static inline void php_array_merge_or_replace_wrapper(INTERNAL_FUNCTION_PARAMETE
 }
 /* }}} */
 
-/* {{{ proto array array_merge(array arr1, array arr2 [, array ...])
+/* {{{ proto array array_merge(array arr1 [, array ...])
    Merges elements from passed arrays into one array */
 PHP_FUNCTION(array_merge)
 {
@@ -3237,7 +3237,7 @@ PHP_FUNCTION(array_merge)
 }
 /* }}} */
 
-/* {{{ proto array array_merge_recursive(array arr1, array arr2 [, array ...])
+/* {{{ proto array array_merge_recursive(array arr1 [, array ...])
    Recursively merges elements from passed arrays into one array */
 PHP_FUNCTION(array_merge_recursive)
 {
@@ -3245,7 +3245,7 @@ PHP_FUNCTION(array_merge_recursive)
 }
 /* }}} */
 
-/* {{{ proto array array_replace(array arr1, array arr2 [, array ...])
+/* {{{ proto array array_replace(array arr1 [, array ...])
    Replaces elements from passed arrays into one array */
 PHP_FUNCTION(array_replace)
 {
@@ -3253,7 +3253,7 @@ PHP_FUNCTION(array_replace)
 }
 /* }}} */
 
-/* {{{ proto array array_replace_recursive(array arr1, array arr2 [, array ...])
+/* {{{ proto array array_replace_recursive(array arr1 [, array ...])
    Recursively replaces elements from passed arrays into one array */
 PHP_FUNCTION(array_replace_recursive)
 {
@@ -4099,7 +4099,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int
                ZVAL_UNDEF(&list->val);
                if (hash->nNumOfElements > 1) {
                        if (behavior == INTERSECT_NORMAL) {
-                               zend_sort((void *) lists[i], hash->nNumOfElements, 
+                               zend_sort((void *) lists[i], hash->nNumOfElements,
                                                sizeof(Bucket), intersect_data_compare_func, (swap_func_t)zend_hash_bucket_swap);
                        } else if (behavior & INTERSECT_ASSOC) { /* triggered also when INTERSECT_KEY */
                                zend_sort((void *) lists[i], hash->nNumOfElements,
index 2dc6207c907bdb24d512d2902197a097304739e0..dac101109a382d5e0274197c856e4df4ee04e9b4 100644 (file)
@@ -393,22 +393,22 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_array_slice, 0, 0, 2)
        ZEND_ARG_INFO(0, preserve_keys)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge, 0, 0, 2)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge, 0, 0, 1)
        ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
        ZEND_ARG_VARIADIC_INFO(0, arrays)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge_recursive, 0, 0, 2)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_merge_recursive, 0, 0, 1)
        ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
        ZEND_ARG_VARIADIC_INFO(0, arrays)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace, 0, 0, 2)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace, 0, 0, 1)
        ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
        ZEND_ARG_VARIADIC_INFO(0, arrays)
 ZEND_END_ARG_INFO()
 
-ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace_recursive, 0, 0, 2)
+ZEND_BEGIN_ARG_INFO_EX(arginfo_array_replace_recursive, 0, 0, 1)
        ZEND_ARG_INFO(0, arr1) /* ARRAY_INFO(0, arg, 0) */
        ZEND_ARG_VARIADIC_INFO(0, arrays)
 ZEND_END_ARG_INFO()
@@ -4042,7 +4042,7 @@ PHP_FUNCTION(long2ip)
  ********************/
 
 /* {{{ proto string getenv(string varname[, bool local_only]
-   Get the value of an environment variable or every available environment variable 
+   Get the value of an environment variable or every available environment variable
    if no varname is present  */
 PHP_FUNCTION(getenv)
 {