Re: [RFC] Specify namespace to include file into.

From: Date: Thu, 08 Mar 2012 17:22:33 +0000
Subject: Re: [RFC] Specify namespace to include file into.
References: 1 2  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
On Thu, 08 Mar 2012 17:51:34 +0100, Michael Morris <[email protected]> wrote

I also don't understand your template argument. Why would you need to namespace templates? Typically they are included from inside a function (and therefore don't change/access the global namespace).
You forget that variable scope and namespace scope have absolutely nothing to do with each other. At all. If I have a template that needs to call a function from within my project's namespace it must either use the fully qualified name of the function or it must declare the namespace it is part of on the first line.
Sorry, I confused things here for a moment. This in fact seems to be a valid use case. But you're only saving a line, and you can't rely on the fallback to globals because it would create an ambiguity. -- Gustavo Lopes

Thread (9 messages)

« previous php.internals (#58795) next »