original_string: protected function getOperatorsForRegex(array $operators, $delimiter = '/')
      {
          // escape operators for use in regex
          $delimiters = array_fill(0, count($operators), $delimiter);
          $escaped = array_map('preg_quote', $operators, $delimiters);
  
          $operators = array_combine($operators, $escaped);
  
          // ignore + & - for now, they'll get special treatment
          unset($operators['+'], $operators['-']);
  
          // dot can not just immediately follow a number; it can be confused for
          // decimal point, or calling a method on it, e.g. 42 .toString()
          $operators['.'] = '(?<![0-9]\s)\.';
  
          // don't confuse = with other assignment shortcuts (e.g. +=)
          $chars = preg_quote('+-*\=<>%&|', $delimiter);
          $operators['='] = '(?<!['.$chars.'])\=';
  
          return $operators;
      }
code: protected function getOperatorsForRegex(array $operators, $delimiter = '/')
      {
          // escape operators for use in regex
          $delimiters = array_fill(0, count($operators), $delimiter);
          $escaped = array_map('preg_quote', $operators, $delimiters);
  
          $operators = array_combine($operators, $escaped);
  
          // ignore + & - for now, they'll get special treatment
          unset($operators['+'], $operators['-']);
  
          // dot can not just immediately follow a number; it can be confused for
          // decimal point, or calling a method on it, e.g. 42 .toString()
          $operators['.'] = '(?<![0-9]\s)\.';
  
          // don't confuse = with other assignment shortcuts (e.g. +=)
          $chars = preg_quote('+-*\=<>%&|', $delimiter);
          $operators['='] = '(?<!['.$chars.'])\=';
  
          return $operators;
      }
code_tokens: protected function getOperatorsForRegex ( array $ operators , $ delimiter = '/' ) { // escape operators for use in regex $ delimiters = array_fill ( 0 , count ( $ operators ) , $ delimiter ) ; $ escaped = array_map ( 'preg_quote' , $ operators , $ delimiters ) ; $ operators = array_combine ( $ operators , $ escaped ) ; // ignore + & - for now, they'll get special treatment unset ( $ operators [ '+' ] , $ operators [ '-' ] ) ; // dot can not just immediately follow a number; it can be confused for // decimal point, or calling a method on it, e.g. 42 .toString() $ operators [ '.' ] = '(?<![0-9]\s)\.' ; // don't confuse = with other assignment shortcuts (e.g. +=) $ chars = preg_quote ( '+-*\=<>%&|' , $ delimiter ) ; $ operators [ '=' ] = '(?<![' . $ chars . '])\=' ; return $ operators ; }
docstring: We'll strip whitespace around certain operators with regular expressions.
  This will prepare the given array by escaping all characters.
  
  @param string[] $operators
  @param string   $delimiter
  
  @return string[]
docstring_tokens: We ll strip whitespace around certain operators with regular expressions . This will prepare the given array by escaping all characters .