Pchp.Library.Arrays.array_merge_recursive C# (CSharp) Method

array_merge_recursive() public static method

Merges arrays recursively.
Integer keys are reset so there cannot be a conflict among them. Conflicts among string keys are resolved by merging associated values into arrays. Merging is propagated recursively. Merged values are dereferenced. References are preserved in non-merged values.
Some array is a null reference (Warning).
public static array_merge_recursive ( PhpArray array ) : PhpArray
array Pchp.Core.PhpArray The first array to merge.
return Pchp.Core.PhpArray
        public static PhpArray array_merge_recursive(PhpArray array, params PhpArray[] arrays)
        {
            if (array == null || arrays == null)
            {
                //PhpException.ArgumentNull((array == null) ? "array" : "arrays");
                //return null;
                throw new ArgumentException();
            }

            for (int i = 0; i < arrays.Length; i++)
            {
                if (arrays[i] == null)
                {
                    //PhpException.Throw(PhpError.Warning, LibResources.GetString("argument_not_array", i + 2));
                    //return null;
                    throw new ArgumentException();
                }
            }

            return MergeRecursive(array, true, arrays);
        }