On Mon, Mar 15, 2021 at 12:32 PM Mark Randall <marand...@php.net> wrote:
>
> 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.

Like any other case insensitive symbol PHP works with that comes from
userland, I would lower it in the engine's side of things. I would not
push the lowercase requirement on the API.

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

Reply via email to