/// <summary> /// Implements <c>+</c> operator on values. /// </summary> public static PhpArray Add(PhpArray x, PhpValue y) { if (y.IsArray) { return(PhpArray.Union(x, y.Array)); } //PhpException.UnsupportedOperandTypes(); //return 0; throw new ArgumentException(); // TODO: ErrCode & return 0 }
/// <summary> /// Implements <c>+</c> operator for unconvertible values or arrays. /// </summary> static PhpValue AddNonNumbers(ref PhpValue x, ref PhpValue y) { if (x.IsArray && y.IsArray) { return((PhpValue)PhpArray.Union(x.Array, y.Array)); } //PhpException.UnsupportedOperandTypes(); //return 0; throw new ArgumentException(); // TODO: ErrCode & return 0 }
/// <summary> /// Implements <c>+</c> operator on values. /// </summary> public static PhpArray Add(PhpArray x, PhpValue y) { var arr = y.AsArray(); // array or &array if (arr != null) { return(PhpArray.Union(x, arr)); } //PhpException.UnsupportedOperandTypes(); //return 0; throw new ArgumentException(); // TODO: ErrCode & return 0 }
/// <summary> /// Implements <c>+</c> operator for unconvertible values or arrays. /// </summary> static PhpValue AddNonNumbers(ref PhpValue x, ref PhpValue y) { var arr_x = x.AsArray(); var arr_y = y.AsArray(); if (arr_x != null && arr_y != null) { return((PhpValue)PhpArray.Union(arr_x, arr_y)); } //PhpException.UnsupportedOperandTypes(); //return 0; throw new ArgumentException(); // TODO: ErrCode & return 0 }