Example #1
0
		/// <summary>
		/// Internal method common for all functions.
		/// </summary>
        private static PhpArray SetOperation(SetOperations op, PhpArray array, PhpArray[] arrays,
            IComparer<KeyValuePair<IntStringKey, object>> comparer)
        {
            if (array == null)
            {
                PhpException.ArgumentNull("array");
                return null;
            }

            if (arrays == null || arrays.Length == 0)
            {
                PhpException.InvalidArgumentCount(null, null);
                return null;
            }

            Debug.Assert(comparer != null);

            PhpArray result = new PhpArray();
            array.SetOperation(op, arrays, comparer, result);

            // the result is inplace deeply copied on return to PHP code:
            result.InplaceCopyOnReturn = true;
            return result;
        }