|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #69384 Add glob_filter() function
Submitted: 2015-04-06 13:38 UTC Modified: 2020-11-18 16:28 UTC
From: bschussek at gmail dot com Assigned:
Status: Suspended Package: Filesystem function related
PHP Version: 5.6.8RC1 OS: Ubuntu 14.04 LTS
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
42 + 2 = ?
Subscribe to this entry?

 [2015-04-06 13:38 UTC] bschussek at gmail dot com
I'd love to see a glob_filter() function that filters an array of file paths for those file paths matching a glob, with the same rules used by glob(). This function is needed when a virtual file system (implemented in PHP) should be globbed for files.


glob_filter(array $paths, string $glob[, int $flags = 0])

$paths - an array of file system paths
$glob - a glob
$flags - the glob() flags

Result: an array of matching file system paths

Test script:
$input = array(

foreach (glob_filter($input, '/*/*.css') as $path) {
    echo $path."\n";

Expected result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-11-18 16:28 UTC]
-Status: Open +Status: Suspended
 [2020-11-18 16:28 UTC]
It seems to me that it isn't hard to implement in userland, and I
don't see a real advantage doing it in C.  As such, this feature
requires discussion for which this bug tracker is not suitable.
So if you, or anybody else, is still interested in this, please
forward the request to the internals mailing list.  For the time
being, I'm suspending this ticket.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Oct 28 06:03:33 2021 UTC