Re: [RFC] Autoloader Classmap

From: Date: Mon, 15 Mar 2021 18:32:10 +0000
Subject: Re: [RFC] Autoloader Classmap
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-113548@lists.php.net to get a copy of this message
On 15/03/2021 17:59, Levi Morrison via internals wrote:
IMO, these should be the defined case of the class, or we should be insensitive about it. It's one thing that our symbols are case insensitive; it is wholly another to _require_ it for this feature by requiring lowercase names. I assume there is some motivation for this; I would like to hear it.
EG(class_table) is stored lowercase, the case of the class name itself is only known once it has been found which could only occur after the autoloader has run. By forcing lowercase we have a single key to lookup for any variation, without it we would have to either match the case exactly (which would be different from how internals currently works) or would have to iterate over every item in the classmap array each time, performing case a insensitive comparisons on every key until one was found, or in the worst case, the entire set.

Thread (26 messages)

« previous php.internals (#113548) next »