|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #50164 glob is case sensitive on windows where filenames are case insensitive.
Submitted: 2009-11-13 09:54 UTC Modified: 2021-10-01 13:19 UTC
Avg. Score:4.4 ± 0.9
Reproduced:4 of 4 (100.0%)
Same Version:3 (75.0%)
Same OS:3 (75.0%)
From: RQuadling at GMail dot com Assigned:
Status: Open Package: Filesystem function related
PHP Version: 5.3.0 OS: win32 only - Windows XP SP3
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:
30 - 6 = ?
Subscribe to this entry?

 [2009-11-13 09:54 UTC] RQuadling at GMail dot com
I'm not sure if this is just a documentation issue or another bug for windows.

Filenames on Windows are accessible case insensitive.

If you have a file ACamelCasedFile.php, then you cannot have a file aCamelCasedFile.PHP as these are considered to be the same name.

So, my expectation of the glob() function on Windows would be to support this aspect of the OS.

So, glob('*camel*') should return the file. Obviously it does not.

Whilst I can use bracing to supply variants, getting all the variants is a lot of effort - camel, Camel, cAmel, CAmel, caMel, CaMel, etc.

Remember that Windows doesn't care, so neither should glob(), at least on windows.

But, having to not break BC, would introducting a new flag GLOB_CASELESS be possible?


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-01 16:32 UTC]
-Package: Feature/Change Request +Package: Filesystem function related
 [2021-10-01 13:19 UTC]
There might be issues regarding case folding as of PHP 7.1.0,
which introduced Unicode filename support on Windows.  At least
with full case foldings, "MASSE" and "Ma├če" are supposed to match,
for instance.  But what would "MA?E" match?  I suggest to leave it
as is.  Otherwise someone would need to pursue the RFC process[1].

[1] <>
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Nov 26 22:05:53 2022 UTC