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:36
Avg. Score:4.8 ± 0.4
Reproduced:36 of 36 (100.0%)
Same Version:11 (30.6%)
Same OS:22 (61.1%)
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 Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 10 05:01:27 2024 UTC