original_string: private function checkPaths($path, array $paths)
      {
          $reserved = [
              '?' => '\?',
              '.' => '\.',
              '*' => '.*',
              '+' => '\+',
              '(' => '\(',
              ')' => '\)',
              '[' => '\[',
              ']' => '\]',
          ];
          $errorHandler = new ErrorHandler();
          set_error_handler([$errorHandler, 'callback'], E_NOTICE | E_WARNING);
          foreach ($paths as $rule) {
              $escaped = str_replace(array_keys($reserved), array_values($reserved), $rule);
              if (preg_match('#^' . $escaped . '#', $path) === 1) {
                  restore_error_handler();
                  return mb_strlen($rule);
              }
          }
          restore_error_handler();
          return false;
      }
code: private function checkPaths($path, array $paths)
      {
          $reserved = [
              '?' => '\?',
              '.' => '\.',
              '*' => '.*',
              '+' => '\+',
              '(' => '\(',
              ')' => '\)',
              '[' => '\[',
              ']' => '\]',
          ];
          $errorHandler = new ErrorHandler();
          set_error_handler([$errorHandler, 'callback'], E_NOTICE | E_WARNING);
          foreach ($paths as $rule) {
              $escaped = str_replace(array_keys($reserved), array_values($reserved), $rule);
              if (preg_match('#^' . $escaped . '#', $path) === 1) {
                  restore_error_handler();
                  return mb_strlen($rule);
              }
          }
          restore_error_handler();
          return false;
      }
code_tokens: private function checkPaths ( $ path , array $ paths ) { $ reserved = [ '?' => '\?' , '.' => '\.' , '*' => '.*' , '+' => '\+' , '(' => '\(' , ')' => '\)' , '[' => '\[' , ']' => '\]' , ] ; $ errorHandler = new ErrorHandler ( ) ; set_error_handler ( [ $ errorHandler , 'callback' ] , E_NOTICE | E_WARNING ) ; foreach ( $ paths as $ rule ) { $ escaped = str_replace ( array_keys ( $ reserved ) , array_values ( $ reserved ) , $ rule ) ; if ( preg_match ( '#^' . $ escaped . '#' , $ path ) === 1 ) { restore_error_handler ( ) ; return mb_strlen ( $ rule ) ; } } restore_error_handler ( ) ; return false ; }
docstring: Check path rule
  
  @param string $path
  @param string[] $paths
  @return int|false
docstring_tokens: Check path rule