php.net |  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
Votes:7
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
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: RQuadling at GMail dot com
New email:
PHP Version: OS:

 

 [2009-11-13 09:54 UTC] RQuadling at GMail dot com
Description:
------------
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?


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-01 16:32 UTC] jani@php.net
-Package: Feature/Change Request +Package: Filesystem function related
 [2021-10-01 13:19 UTC] cmb@php.net
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] <https://wiki.php.net/rfc/howto>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 13:01:28 2024 UTC