original_string: private static function doGlobForExpandedPath($filename, $options) {
      $openpath = static::getDirNameForPath($filename);
      $dirname = pathinfo($filename, PATHINFO_DIRNAME);
      $basename = static::getBaseNameForPath($filename);
  
      $results = [];
      $handle = @opendir($openpath);
  
      if ($handle === false) {
        return false;
      }
      while (($name = readdir($handle)) !== false) {
        if (static::isFileNamePatternMatch($name, $basename, $options)) {
          if (strpos($filename, DIRECTORY_SEPARATOR) !== false) {
            $name = $dirname . DIRECTORY_SEPARATOR . $name;
          }
          $results[] = $name;
        }
      }
      closedir($handle);
  
      if ($options & (GLOB_MARK | GLOB_ONLYDIR)) {
        $results = static::doDirectoryOptions($dirname, $results, $options);
      }
  
      return $results;
    }
code: private static function doGlobForExpandedPath($filename, $options) {
      $openpath = static::getDirNameForPath($filename);
      $dirname = pathinfo($filename, PATHINFO_DIRNAME);
      $basename = static::getBaseNameForPath($filename);
  
      $results = [];
      $handle = @opendir($openpath);
  
      if ($handle === false) {
        return false;
      }
      while (($name = readdir($handle)) !== false) {
        if (static::isFileNamePatternMatch($name, $basename, $options)) {
          if (strpos($filename, DIRECTORY_SEPARATOR) !== false) {
            $name = $dirname . DIRECTORY_SEPARATOR . $name;
          }
          $results[] = $name;
        }
      }
      closedir($handle);
  
      if ($options & (GLOB_MARK | GLOB_ONLYDIR)) {
        $results = static::doDirectoryOptions($dirname, $results, $options);
      }
  
      return $results;
    }
code_tokens: private static function doGlobForExpandedPath ( $ filename , $ options ) { $ openpath = static :: getDirNameForPath ( $ filename ) ; $ dirname = pathinfo ( $ filename , PATHINFO_DIRNAME ) ; $ basename = static :: getBaseNameForPath ( $ filename ) ; $ results = [ ] ; $ handle = @ opendir ( $ openpath ) ; if ( $ handle === false ) { return false ; } while ( ( $ name = readdir ( $ handle ) ) !== false ) { if ( static :: isFileNamePatternMatch ( $ name , $ basename , $ options ) ) { if ( strpos ( $ filename , DIRECTORY_SEPARATOR ) !== false ) { $ name = $ dirname . DIRECTORY_SEPARATOR . $ name ; } $ results [ ] = $ name ; } } closedir ( $ handle ) ; if ( $ options & ( GLOB_MARK | GLOB_ONLYDIR ) ) { $ results = static :: doDirectoryOptions ( $ dirname , $ results , $ options ) ; } return $ results ; }
docstring: Glob a given path.
  
  At this point any braces and path wildcards have been expaneded.
  @param string $path The path to glob, can contain wildcards.
  @param int $options Valid Glob flags.
  @return Returns an array containing the matched files/directories, an
  empty array if no file matched or FALSE on error.
docstring_tokens: Glob a given path .