php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48129 spl_autoload and case sensitive
Submitted: 2009-05-02 06:02 UTC Modified: 2009-05-02 18:34 UTC
Votes:35
Avg. Score:4.8 ± 0.4
Reproduced:35 of 35 (100.0%)
Same Version:11 (31.4%)
Same OS:22 (62.9%)
From: ti dot webdev at gmail dot com Assigned:
Status: Wont fix Package: SPL related
PHP Version: 5.2.9 OS: *
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: ti dot webdev at gmail dot com
New email:
PHP Version: OS:

 

 [2009-05-02 06:02 UTC] ti dot webdev at gmail dot com
Description:
------------
spl_autoload function load strtolower($className.$ext) files only


Reproduce code:
---------------
<?
spl_autoload('mylowercaseclass');
spl_autoload('MyClass');

Expected result:
----------------
Loaded mylowercaseclass.php file
Loaded MyClass.php file

Actual result:
--------------
Loaded mylowercaseclass.php file
LogicException: Class MyClass could not be loaded

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-02 16:15 UTC] colder@php.net
spl_autoload first strtolowers the class name before the lookup, so basically if you use spl_autoload("MyClass") it will look for myclass.php.

I'm not sure "fixing it" right now is a good idea since it would break BC.
 [2009-05-02 18:34 UTC] jani@php.net
Breaking BC is not an option. 
 [2011-08-10 01:18 UTC] bram048 at gmail dot com
I would kindly ask the PHP developer team to reconsider this bug. There are enough 
alternatives to fix this behaviour without breaking BC; see bug report #48129.
 
PHP Copyright © 2001-2017 The PHP Group
All rights reserved.
Last updated: Sun Nov 19 01:31:42 2017 UTC