Re: [RFC] Function Autoloading (mark 5)
| From: | Michael Morris | Date: | Tue, 07 Jul 2026 16:56:47 +0000 |
| Subject: | Re: [RFC] Function Autoloading (mark 5) | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-131798@lists.php.net to get a copy of this message | ||
On Tue, Jul 7, 2026 at 12:45 PM Paul M. Jones <pmjones@pmjones.io> wrote:
> Hi all,
>
> I have updated the RFC and PR to add the
strict_namespace=1
> directive as
> a way of solving for the global-fallback shadow-function case.
>
> I have also added some research on how prevalent that case actually is; it
> turns out to be extremely rare among the top 1000 Packagist packages:
>
> > In the end, it looks like there are only 2 packages and 8 call sites
> that would behave unexpectedly if they converted to function autoloading
> and dropped their include calls. Either a use function import or
> declare(strict_namespace=1) would fix each one.
>
> I have not yet added the "motivation" section, as indicated by earlier
> comments, but still plan on doing so.
>
> Please review again as convenient!
>
>
> -- pmj
>
On another thread I've put in another way to accomplish this that is free
of the load order problems, can address constants as well and allows for
other actions related to namespace setup to be performed. "Improved
Autoloader" is the title.