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.


--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to