|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #53065 Allow spl_autoload to be case sensitive on *nix
Submitted: 2010-10-14 13:33 UTC Modified: 2020-06-10 09:37 UTC
Avg. Score:4.8 ± 0.5
Reproduced:81 of 85 (95.3%)
Same Version:43 (53.1%)
Same OS:45 (55.6%)
From: staff at pro-unreal dot de Assigned:
Status: Wont fix Package: SPL related
PHP Version: 5.3.3 OS: Ubuntu Linux 10.04
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2010-10-14 13:33 UTC] staff at pro-unreal dot de
I Opened This because #48129 is set to "won't fix". But this affects major frameworks i.e. (ZendFramework, FLOW3).It would be nice to tell spl_autoload() not to lowercase all filenames so that these framworks can benefit from its performance.

To stay backwards compatible this could be done via php.ini or a function call.
I would suggest spl_autoload_casesensitive in php.ini or a method spl_autoload_casesensitive(bool $flag);

Another more compatible option could be handling this inside of spl_autoload().
Check for unmodified case first (i.e. Zend/Db/Adapter/Abstract.php) and if this is not available try lowercased (i.e. zend/db/adapter/abstract.php)

This Solutions won't break BC!

Test script:

namespace Test;
use Zend\Controller;


// this should load from correct ZF path: Zend/Controller/Front.php;
$request = new Controller\Front();

Expected result:
Class should be loaded from Zend/Controller/Front.php in include path

Actual result:
Class is always loaded from zend/controller/front.php in include path


spl_autoload_case_sensitive (last revision 2010-12-27 14:34 UTC by marc at easen dot co dot uk)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-04 10:23 UTC] chris at cmbuckley dot co dot uk
See Bug #49852 for the same bug in the 5.2 branch.
 [2020-06-10 09:37 UTC]
-Status: Open +Status: Wont fix
 [2020-06-10 09:37 UTC]
I'll go ahead and mark this as "won't fix". Realistically, the ecosystem has moved away from spl_autoload() a long time ago, in conjunction with the rise of composer. I don't think it makes sense to extend this API any more at this point in time. If anything we should just deprecate it (though there's not much point to that either).
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Wed Oct 04 10:01:25 2023 UTC