Returns proper dynamic types.

@param Variable $left
@param Variable $right

@return string
513372
private function getDynamicTypes(Variable $left, Variable $right)
    {
        if ('/' == $this->operator) {
            return 'double';
        }

        switch ($left->getType()) {
            case 'int':
            case 'uint':
            case 'long':
            case 'ulong':
                switch ($right->getType()) {
                    case 'int':
                    case 'uint':
                    case 'long':
                    case 'ulong':
                        return 'int';
                }
                break;
        }

        return 'double';
    }
1315037
public function add($left, $right) {
        if (empty($left)) {
            return $right;
        } elseif (empty($right)) {
            return $left;
        }
        $negative = '';
        if ($left[0] == '-' && $right[0] == '-') {
            $negative = '-';
            $left     = substr($left, 1);
            $right    = substr($right, 1);
        } elseif ($left[0] == '-') {
            return $this->subtract($right, substr($left, 1));
        } elseif ($right[0] == '-') {
            return $this->subtract($left, substr($right, 1));
        }
        $left   = $this->normalize($left);
        $right  = $this->normalize($right);
        $result = BaseConverter::convertFromBinary(
            $this->addBinary($left, $right),
            '0123456789'
        );
        return $negative . $result;
    }
977407
public static function merge($left, $right)
	{
		if (is_array($left) && is_array($right)) {
			foreach ($left as $key => $val) {
				if (is_int($key)) {
					$right[] = $val;
				} else {
					if (isset($right[$key])) {
						$val = static::merge($val, $right[$key]);
					}
					$right[$key] = $val;
				}
			}

			return $right;

		} elseif ($left === NULL && is_array($right)) {
			return $right;

		} else {
			return $left;
		}
	}
206485
public function mergeWithCombine($left, $right)
    {
        if (is_array($left) && is_array($right)) {
            foreach ($left as $key => $val) {
                if (is_int($key)) {
                    $right[] = $val;
                } else {
                    if (isset($right[$key])) {
                        $val = $this->mergeWithCombine($val, $right[$key]);
                    }
                    $right[$key] = $val;
                }
            }
            return $right;
        } elseif ($left === null && is_array($right)) {
            return $right;
        }

        if (! empty($right) && (array) $left !== (array) $right) {
            return $this->mergeWithCombine((array) $right, (array) $left);
        }

        return $left;
    }
456617
public static function getTypeFromPHPVariable($variable) : ?Type
    {
        if (is_object($variable)) {
            if ($variable instanceof DateTimeInterface) {
                return self::getType('date');
            }

            if ($variable instanceof ObjectId) {
                return self::getType('id');
            }
        } else {
            $type = gettype($variable);
            switch ($type) {
                case 'integer':
                    return self::getType('int');
            }
        }
        return null;
    }
422483
protected function evalVarLabel($variable)
    {
        $type = $this->getType($variable);
        switch ($type) {
            case 'object':
                return $this->evalObjLabel($variable);

            case 'array':
                return $type . '('.count($variable).')';

            default:
                return $type;
        }
    }
578363
public static function getType($var){
        if(is_int($var)){
            return self::T_INTEGER;
        }else if(is_string($var)){
            return self::T_STRING;
        }else if(is_float($var)){
            return self::T_FLOAT;
        }else if(is_bool($var)){
            return self::T_BOOLEAN;
        }else if(is_array($var)){
            return self::T_ARRAY;
        }else if(is_object($var)){
            return self::T_OBJECT;
        }else if(is_resource($var)){
            return self::T_RESOURCE;
        }else if($var === null){
            return self::T_NULL;
        }
        
        return self::T_UNKNOWN;
    }
1287216
protected function queryBetween($left, $right, $leftIncluded = false, $rightIncluded = false)
    {
        $positionColumn = $this->getOrderColumnName();

        $leftOperator = $leftIncluded ? '>=' : '>';
        $rightOperator = $rightIncluded ? '<=' : '<';

        $query = $this->newPivotQuery();

        return $query->where($positionColumn, $leftOperator, $left)->where($positionColumn, $rightOperator, $right);
    }
1178821
public function getSibling($right = true)
	{
		if (!$this->_allChildrenloaded)
		{
			$temp = $this->_constructor->get($this->id, true);
			$this->_children = $temp->getChildren();
			$this->_leftSibling = $temp->getSibling(false);
			$this->_rightSibling = $temp->getSibling(true);
			$this->setAllLoaded();
		}

		if ($right)
		{
			return $this->_rightSibling;
		}
		else
		{
			return $this->_leftSibling;
		}
	}
726816
protected function opEq($left, $right)
    {
        if (($lStr = $this->coerceString($left)) && ($rStr = $this->coerceString($right))) {
            $lStr[1] = '';
            $rStr[1] = '';

            $left = $this->compileValue($lStr);
            $right = $this->compileValue($rStr);
        }

        return $this->toBool($left === $right);
    }
120492
protected function objectEquals($left, $right)
    {
        if (!is_object($right)) {
            return false;
        }
        if (get_class($left) !== get_class($right)) {
            return false;
        }

        $stackKey = $this->objectComparisonStackKey($left, $right);
        if (array_key_exists($stackKey, $this->objectComparisonStack)) {
            return true;
        }
        $this->objectComparisonStack[$stackKey] = true;

        return $this->arrayEquals(
            $this->objectProperties($left),
            $this->objectProperties($right)
        );
    }
1040308
protected function opDivNumberNumber($left, $right)
    {
        if ($right[1] == 0) {
            return [Type::T_STRING, '', [$left[1] . $left[2] . '/' . $right[1] . $right[2]]];
        }

        return new Node\Number($left[1] / $right[1], $left[2]);
    }
1031812
public function wrap( $left = NULL, $right = NULL )
	{
		$length			= $this->getLength();
		$this->string	= (string) $left . $this->string . (string) $right;
		return $this->getLength() - $length;
	}
135143
protected function div($left, $right, $precision)
    {
        if (is_null($precision)) return $left / $right;
        return floatval(\bcdiv($left, $right, $precision));
    }
587315
protected function mul($left, $right, $precision)
    {
        if (is_null($precision)) return $left * $right;
        return floatval(\bcmul($left, $right, $precision));
    }
1155844
protected function opColorColor($op, $left, $right)
    {
        $out = [Type::T_COLOR];

        foreach ([1, 2, 3] as $i) {
            $lval = isset($left[$i]) ? $left[$i] : 0;
            $rval = isset($right[$i]) ? $right[$i] : 0;

            switch ($op) {
                case '+':
                    $out[] = $lval + $rval;
                    break;

                case '-':
                    $out[] = $lval - $rval;
                    break;

                case '*':
                    $out[] = $lval * $rval;
                    break;

                case '%':
                    $out[] = $lval % $rval;
                    break;

                case '/':
                    if ($rval == 0) {
                        $this->throwError("color: Can't divide by zero");
                        break 2;
                    }

                    $out[] = (int) ($lval / $rval);
                    break;

                case '==':
                    return $this->opEq($left, $right);

                case '!=':
                    return $this->opNeq($left, $right);

                default:
                    $this->throwError("color: unknown op $op");
                    break 2;
            }
        }

        if (isset($left[4])) {
            $out[4] = $left[4];
        } elseif (isset($right[4])) {
            $out[4] = $right[4];
        }

        return $this->fixColor($out);
    }
753021
protected function getValueType($val)
    {
        $type = 'String';
        if ($this->auto_convert_types === true && is_numeric($val)) {
            $type = 'Number';
        }

        return $type;
    }