|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #69383 Add glob_match() function
Submitted: 2015-04-06 13:32 UTC Modified: 2019-10-13 04:22 UTC
From: bschussek at gmail dot com Assigned: cmb (profile)
Status: No Feedback 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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: bschussek at gmail dot com
New email:
PHP Version: OS:


 [2015-04-06 13:32 UTC] bschussek at gmail dot com
I'd love to see a function glob_match() that matches a path against a glob using the same rules used by glob(). This function is needed when a virtual file system (implemented in PHP) should be globbed for files.


glob_match(string $path, string $glob[, int $flags = 0])

$path - a file system path
$glob - a glob
$flags - the glob() flags

Result: true if the path matches, false otherwise

Test script:

var_dump(glob_match('css/style.css', '*/*.css'));
var_dump(glob_match('js/script.js', '*/*.css'));

Expected result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-04-06 13:33 UTC] bschussek at gmail dot com
-Type: Bug +Type: Feature/Change Request
 [2015-04-06 13:33 UTC] bschussek at gmail dot com
Changed type to feature request
 [2019-09-29 12:25 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2019-09-29 12:25 UTC]
Are you looking for fnmatch[1]?

[1] <>
 [2019-10-13 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Nov 30 20:01:27 2020 UTC