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;
    }
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;
    }
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 ; }
Equivalent to PHP `glob` function.

@param  string $pattern
@return array
Equivalent to PHP glob function .