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;
    }
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;
    }
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 ; }
Add two numbers together

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

@return string A base-10 string of the sum of the two arguments
Add two numbers together