Re: [RFC] Autoloader Classmap

From: Date: Tue, 16 Mar 2021 14:27:26 +0000
Subject: Re: [RFC] Autoloader Classmap
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to internals+get-113565@lists.php.net to get a copy of this message
On Tue, Mar 16, 2021 at 8:02 AM Mark Randall <marandall@php.net> wrote:

> On 15/03/2021 22:18, Levi Morrison via internals wrote:
> > 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.
>
> That was the first design, however it required re-creating the array
> with potentially many thousands of new strings which slowed it down
> considerably.
>
> As I envisenge this to be used with machine generated data, having it
> use lowercase would not be an issue.
>

If lower case key names weren't a requirement for the user, but the engine
worked on lower case keys, how would something like this behave:

$map['myClass'] = '/path/to/lib/myclass1.php'
$map['myclass'] = '/path/to/lib/myclass2.php'


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

-- 
Chase Peeler
chasepeeler@gmail.com


Thread (26 messages)

« previous php.internals (#113565) next »