original_string: public function glob($pattern)
      {
          $matched = [];
          $pattern = $this->realpath($pattern);
          $pattern = '@^' . str_replace(['\*', '\?'], ['[^\\\/]*', '.'], preg_quote($pattern)) .'$@';
          foreach (array_keys($this->files) as $path) {
              if (preg_match($pattern, $path))
                  $matched[] = $path;
          }
          return $matched;
      }
code: public function glob($pattern)
      {
          $matched = [];
          $pattern = $this->realpath($pattern);
          $pattern = '@^' . str_replace(['\*', '\?'], ['[^\\\/]*', '.'], preg_quote($pattern)) .'$@';
          foreach (array_keys($this->files) as $path) {
              if (preg_match($pattern, $path))
                  $matched[] = $path;
          }
          return $matched;
      }
code_tokens: public function glob ( $ pattern ) { $ matched = [ ] ; $ pattern = $ this -> realpath ( $ pattern ) ; $ pattern = '@^' . str_replace ( [ '\*' , '\?' ] , [ '[^\\\/]*' , '.' ] , preg_quote ( $ pattern ) ) . '$@' ; foreach ( array_keys ( $ this -> files ) as $ path ) { if ( preg_match ( $ pattern , $ path ) ) $ matched [ ] = $ path ; } return $ matched ; }
docstring: Equivalent to PHP `glob` function.
  
  @param  string $pattern
  @return array
docstring_tokens: Equivalent to PHP glob function .