Re: [PHP-DEV] [RFC] Function Autoloading (mark 5)
"Rowan Tommins [IMSoP]" <[email protected]> Fri, 31 Jul 2026 22:57:06 +0100
| Newsgroups | gmane.comp.php.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Tim,=20 I posted this in the other thread, but I'm not sure it got through, so I'l= l repost here; apologies if both show up at once=2E On 31 July 2026 18:12:01 BST, "Tim D=C3=BCsterhus" <tim@bastelstu=2Ebe> wr= ote: >> Without giving it detailed thought, I believe =E2=80=9CNamespaced funct= ion, Autoload namespaced function, Global fallback=E2=80=9D (i=2Ee=2E swap = steps 2 and 3) would result in much more predictable semantics already - th= e global fallback would work just as before, it just wouldn't have autoload= ing 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]