Re: [RFC] Function Autoloading (mark 5)
| From: | Rowan Tommins [IMSoP] | Date: | Fri, 31 Jul 2026 21:57:06 +0000 |
| Subject: | Re: [RFC] Function Autoloading (mark 5) | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-132158@lists.php.net to get a copy of this message | ||
Hi Tim,
I posted this in the other thread, but I'm not sure it got through, so I'll repost here;
apologies if both show up at once.
On 31 July 2026 18:12:01 BST, "Tim Düsterhus" <tim@bastelstu.be> wrote:
>> Without giving it detailed thought, I believe “Namespaced function, Autoload namespaced
>> function, Global fallback” (i.e. swap steps 2 and 3) would result in much more predictable
>> semantics already - the global fallback would work just as before, it just wouldn't have
>> autoloading support.
Semantically, that makes most sense, but it leads to terrible performance for the global fallback
case, unless there's some way to avoid multiple checks for the same namespaced function.
That's why we keep going round in circles on the whole issue.
I think Michael's "namespace autoloader" idea is a much cleaner way forward - it
avoids the fallback issue without creating lots of extra special cases, and in reality "load a
file with all functions for namespace Foo\Bar" is likely to be more common than "load a
file which specifically defines function Foo\Bar\baz()".
Regards,
Rowan Tommins
[IMSoP]