Add two binary strings together

@param string $left  The left argument
@param string $right The right argument

@return string The binary result
503003
protected function addBinary($left, $right) {
        $len    = max(strlen($left), strlen($right));
        $left   = str_pad($left, $len, chr(0), STR_PAD_LEFT);
        $right  = str_pad($right, $len, chr(0), STR_PAD_LEFT);
        $result = '';
        $carry  = 0;
        for ($i = 0; $i < $len; $i++) {
            $sum     = ord($left[$len - $i - 1])
                 + ord($right[$len - $i - 1])
                 + $carry;
            $result .= chr($sum % 256);
            $carry   = $sum >> 8;
        }
        while ($carry) {
            $result .= chr($carry % 256);
            $carry >>= 8;
        }
        return strrev($result);
    }
680085
public void composeLeftLeftInv(IntBitRelation left, IntBitRelation right) {
        int i, a, b;
        IntBitSet li, ri;

        for (i = 0; i < line.length; i++) {
            li = left.line[i];
            ri = right.line[i];
            if (li != null && ri != null) {
                for (a = li.first(); a != -1; a = li.next(a)) {
                    for (b = ri.first(); b != -1; b = ri.next(b)) {
                        add(b, a);
                    }
                }
            }
        }
    }
736500
public function rightJoin($table, $leftKey, $rightKey)
	{
		$this->syntax->setJoin($table, $leftKey, $rightKey, 'right');
		return $this;
	}
294935
public static function equal(Expr $left, Expr $right) : BinOp
    {
        return new BinOp($left, BinOp::EQUAL, $right);
    }
929207
protected function opCmpNumberNumber($left, $right)
    {
        $n = $left[1] - $right[1];

        return new Node\Number($n ? $n / abs($n) : 0, '');
    }
120949
private static function padString(string $string, int $left, int $right, string $char): string
    {
        $leftPadding = str_repeat($char, $left);
        $rightPadding = str_repeat($char, $right);

        return $leftPadding.$string.$rightPadding;
    }
57591
public void composeRightLeft(IntBitRelation left, IntBitRelation right) {
        int i, ele;
        IntBitSet li;

        for (i = 0; i < left.line.length; i++) {
            li = left.line[i];
            if (li != null) {
                for (ele = li.first(); ele != -1; ele = li.next(ele)) {
                    if (right.line[ele] != null) {
                        add(i, right.line[ele]);
                    }
                }
            }
        }
    }
162758
public function binary($operator = null, AbstractBuilder $leftExpression = null, AbstractBuilder $rightExpression = null)
    {
        return new BinaryOperator($operator, $leftExpression, $rightExpression);
    }
906321
protected function queryBetween($left, $right)
    {
        $sortableField = static::getSortableField();
        $query = static::applySortableGroup($this->newQuery(), $this);

        return $query->where($sortableField, '>', $left)->where($sortableField, '<', $right);
    }
99970
def binary(left, operator, right)
      parentheses do
        left.visit(self)
        append(" #{operator} ")
        right.visit(self)
      end
    end
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);
    }
22127
public function addRightCtrls($rightCtrls = null)
    {
        if (!is_string($rightCtrls)) {
            return $this;
        }
        $this->rightCtrls = $rightCtrls;
        return $this;
    }
666800
function addAnd($left, $right = null, $operator = Query::EQUAL, $quote = null) {
		if (null === $left) {
			return $this;
		}

		if (is_array($left)) {
			foreach ($left as $key => &$value) {
				$this->addAnd($key, $value);
			}
			return $this;
		}

		$this->conds[] = array('AND', func_get_args());
		return $this;
	}
1358030
public static function setDelimiter(&$context, $left = null, $right = null) {
        if ($left === null) {
            $left = $context['delimiters'][0];
        }
        if ($right === null) {
            $right = $context['delimiters'][1];
        }
        if (preg_match('/=/', "$left$right")) {
            $context['error'][] = "Can not set delimiter contains '=' , you try to set delimiter as '$left' and '$right'.";
            return;
        }

        $context['tokens']['startchar'] = substr($left, 0, 1);
        $context['tokens']['left'] = $left;
        $context['tokens']['right'] = $right;
        $rawcount = $context['rawblock'] ? '{2}' : ($context['flags']['rawblock'] ? '{0,2}' : '?');
        $left = preg_quote($left);
        $right = preg_quote($right);

        $context['tokens']['search'] = "/^(.*?)(\\s*)($left)(~?)(\\{{$rawcount})\\s*([\\^#\\/!&>\\*]{0,2})(.*?)\\s*(\\}{$rawcount})(~?)($right)(\\s*)(.*)\$/s";
    }
415568
public function onArithmeticExpression($expressionType, $left, $right)
    {
        $type = $this->unpackExpressionType($expressionType);
        switch ($type) {
            case ExpressionType::MULTIPLY:
                return $this->prepareBinaryExpression(self::MULTIPLY, $left, $right);
            case ExpressionType::DIVIDE:
                return $this->prepareBinaryExpression(self::DIVIDE, $left, $right);
            case ExpressionType::MODULO:
                return $this->prepareBinaryExpression(self::MODULO, $left, $right);
            case ExpressionType::ADD:
                return $this->prepareBinaryExpression(self::ADD, $left, $right);
            case ExpressionType::SUBTRACT:
                return $this->prepareBinaryExpression(self::SUBTRACT, $left, $right);
            default:
                throw new \InvalidArgumentException('onArithmeticExpression');
        }
    }
1270054
public static function compare($left, $right){
		if($left->a != $right->a) return $left->a <=> $right->a;
		if($left->b != $right->b) return $left->b <=> $right->b;
		if($left->c != $right->c) return $left->c <=> $right->c;
		if($left->i < 0 || $right->i < 0) return 0;
		return $left->i <=> $right->i;
	}
469474
protected function arrayEquals(array $left, $right)
    {
        if (!is_array($right)) {
            return false;
        }
        if (array_keys($left) !== array_keys($right)) {
            return false;
        }

        foreach ($left as $key => $value) {
            if (!$this->valueEquals($value, $right[$key])) {
                return false;
            }
        }

        return true;
    }