original_string: protected function _add(Matrix $other, $sign = 1)
      {
          $a1 = $this->toArray();
          $a2 = $other->toArray();
  
          $newMatrix = [];
          for ($i = 0; $i < $this->rows; ++$i) {
              for ($k = 0; $k < $this->columns; ++$k) {
                  $newMatrix[$i][$k] = $a1[$i][$k] + $sign * $a2[$i][$k];
              }
          }
  
          return new self($newMatrix, false);
      }
code: protected function _add(Matrix $other, $sign = 1)
      {
          $a1 = $this->toArray();
          $a2 = $other->toArray();
  
          $newMatrix = [];
          for ($i = 0; $i < $this->rows; ++$i) {
              for ($k = 0; $k < $this->columns; ++$k) {
                  $newMatrix[$i][$k] = $a1[$i][$k] + $sign * $a2[$i][$k];
              }
          }
  
          return new self($newMatrix, false);
      }
code_tokens: protected function _add ( Matrix $ other , $ sign = 1 ) { $ a1 = $ this -> toArray ( ) ; $ a2 = $ other -> toArray ( ) ; $ newMatrix = [ ] ; for ( $ i = 0 ; $ i < $ this -> rows ; ++ $ i ) { for ( $ k = 0 ; $ k < $ this -> columns ; ++ $ k ) { $ newMatrix [ $ i ] [ $ k ] = $ a1 [ $ i ] [ $ k ] + $ sign * $ a2 [ $ i ] [ $ k ] ; } } return new self ( $ newMatrix , false ) ; }
docstring: Element-wise addition or substraction depending on the given sign parameter
  
  @param Matrix $other
  @param int    $sign
  
  @return Matrix
docstring_tokens: Element - wise addition or substraction depending on the given sign parameter