On Tue, 11 Apr 2023 at 09:48, Rowan Tommins <rowan.coll...@gmail.com> wrote:
>
> Similarly, I think it should be possible to "unpin" a function
> lookup with a later definition,

Can you say what the technical justification for that is?

There's reasons why (imo) it's probably wrong, but I don't currently
understand what you would want it for, so want to make sure I don't
miss something in my response.

> This isn't actually true: classes, interfaces, traits, and enums all share
> a symbol table, and thus an autoloader. I don't know of a good name for
> this symbol table, though.

As per the RFC it would probably just be 'type'. When PHP is compiling
some code:

function foo(Bar $bar): Quux { ... }

Before 'Bar' and 'Quux' are loaded, the only thing that is safe to
assume about them is that they are a type, whether that be a class
either with methods or without (also called an interface), or an enum,
or eventually a type alias like `type number = float|int;`.


> Regarding the API, would it be possible to take advantage of nearly
> all autoloaders only being interested in particular namespace prefixes?

Lots of things are possible, but I'd strongly prefer to have that be a
separate discussion, which it's listed as a future scope:
https://wiki.php.net/rfc/core-autoloading#higher_performance_through_maps

If nothing else, it's going to take people time to figure out how they
are going to organise code that is 'just' a bunch of functions.

cheers
Dan
Ack

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

Reply via email to