Re: Idea: Function autoloading using dummy namespaces
| From: | Stanislav Malyshev | Date: | Mon, 18 Jul 2016 00:50:38 +0000 |
| Subject: | Re: Idea: Function autoloading using dummy namespaces | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-94544@lists.php.net to get a copy of this message | ||
Hi!
> How about an alternative approach where a function inside a namespace
> can be autoloaded using the existing callback, by using a reserved
> namespace segment? So to autoload function "foo\bar()", the engine would
> construct a string like "__function\foo\bar" or "foo\__function\bar",
> and pass that to the registered autoloader stack.
Magic out-of-domain values usually are bad design, and lead to a lot of
trouble since now the system needs to deal with two sets of assumptions
instead of one. I wouldn't recommend doing it.
--
Stas Malyshev
smalyshev@gmail.com