On Mon, Jul 18, 2016 at 4:53 AM, Nikita Popov <nikita....@gmail.com> wrote:

>
> Option B: foo() in namespace Bar will
> a) Check if Bar\foo() exists
> b) Otherwise check if foo() exists
> c) Otherwise try to load 'Bar\foo'
> d) Otherwise try to load 'foo'
> e) If all fails, throw.
>
> This avoids the autoloading overhead when calling functions from the global
> namespace. However this also means that you cannot autoload a function with
> the same name as a global function through an unqualified call.
>
>
 Doesn't this mean that an innocent introduction of global function "foo()"
could break "namespace Bar { foo(); }", since it would then refer to the
global function "foo" (step b) and "Bar\foo" would not be autoloaded (step
c)?

Reply via email to