|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-11-24 11:15 UTC] jani@php.net
-Package: Feature/Change Request
+Package: SPL related
[2012-09-07 17:36 UTC] eugeny dot p at gmail dot com
[2020-06-10 09:34 UTC] nikic@php.net
-Status: Open
+Status: Duplicate
[2020-06-10 09:34 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Nov 03 14:00:01 2025 UTC |
Description: ------------ This is related to #49625 Ok I agree that spl_autoload() won't be touched because of BC (Seems the convention to lowercase all filenames has been borrowed from Java and ppl are actually using it). How about a case sensitive function spl_autoload_cs() then? It should behave excactly like spl_autoload() except that it skips the lowercasing stuff. Projects using a case sensitive naming convention (PEAR, Zend Framework, ...) can unregister the default spl_autoload() and register spl_autoload_cs() and it will work. I am aware that it is possible to write an own callback in PHP. The problem is that you can't write the callback once and then put it in your codebase because the callback is the glue between your script and the codebase. I do a lot of scripting PHP on the CLI and am tired of duplicating my callback function code over and over again just to make sure the script will work with a case sensitive design paradim. Reproduce code: --------------- <?php /** * proposed usage of new feature spl_autoload_cs() */ spl_autoload_unregister('spl_autoload'); spl_autoload_register('spl_autoload_cs'); // executing a PEAR class would work now $phpbin = System::which('php'); ?>