Re: Re: Function autoloading
| From: | Nicolas Grekas | Date: | Sun, 01 Sep 2013 15:27:31 +0000 |
| Subject: | Re: Re: Function autoloading | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-68818@lists.php.net to get a copy of this message | ||
My previous message didn't push the point I wanted raise: don't we have a
major problem related to at-run-time namespace resolution for functions and
constants?
Take this code: namespace foo { strlen("bar"); }
Will you trigger an autoload for foo\strlen?
I believe not because that would hurt performance too much.
But then, how will you load function foo\strlen if it exists?
Now take this code: namespace foo { bar(); }
Will you trigger autoload for "foo\bar" first, then for "bar"?
Only for "foo\bar"? But then, what if "bar" exists and just waits being
autoloaded?
I fail to see how autoloading functions is compatible with at-run-time
namespace resolution.