Edit report at https://bugs.php.net/bug.php?id=63617&edit=1

 ID:                 63617
 Updated by:         [email protected]
 Reported by:        soapergem at gmail dot com
 Summary:            Make file_exists() case insensitive
-Status:             Open
+Status:             Wont fix
 Type:               Feature/Change Request
 Package:            Filesystem function related
 Operating System:   *nix
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

PHP relies on the underlying semantics of the file system: if the file system 
is case insensitive (and some file systems are or optionally can be on *nix 
systems — for example, HFS+ on OS X), then PHP will behave accordingly.

Having PHP behave differently to other programs on the same system would 
definitely violate the principle of least surprise, quite aside from the 
(non-trivial) amount of work required.

Closing Won't Fix.


Previous Comments:
------------------------------------------------------------------------
[2012-11-27 04:14:04] soapergem at gmail dot com

Description:
------------
Currently file_exists() is case insensitive on Windows, but not on *nix 
platforms. 
This makes it difficult to migrate from Windows back to *nix. Forcing 
file_exists() to always be case insensitive would be of great benefit in these 
scenarios. I'm not sure what the engineering behind it would involve, but I 
thought I'd ask!

Test script:
---------------
<?php

$dir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
var_dump(file_exists($dir . 'cAsE_mAtTeRs.php'));

?>

Expected result:
----------------
true

Actual result:
--------------
false


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63617&edit=1

Reply via email to