Re: [PHP-DEV] [RFC] [VOTE] Function Autoloading (mark 5)
[email protected] ("Rowan Tommins [IMSoP]") Fri, 31 Jul 2026 17:07:44 +0100
| Newsgroups | php.internals |
|---|---|
| Message-ID | <[email protected]> |
Hi Tim, On 31 July 2026 16:52:21 BST, "Tim D=C3=BCsterhus" <tim@bastelstu=2Ebe> wr= ote: >Without giving it detailed thought, I believe =E2=80=9CNamespaced functio= n, Autoload namespaced function, Global fallback=E2=80=9D (i=2Ee=2E swap st= eps 2 and 3) would result in much more predictable semantics already - the = global fallback would work just as before, it just wouldn't have autoloadin= g support=2E Semantically, that makes most sense, but it leads to terrible performance = for the global fallback case, unless there's some way to avoid multiple che= cks for the same namespaced function=2E That's why we keep going round in c= ircles on the whole issue=2E=20 I think Michael's "namespace autoloader" idea is a much cleaner way forwar= d - it avoids the fallback issue without creating lots of extra special cas= es, and in reality "load a file with all functions for namespace Foo\Bar" i= s likely to be more common than "load a file which specifically defines fun= ction Foo\Bar\baz()"=2E Regards, Rowan Tommins [IMSoP]