Rasmus Lerdorf wrote:
Are you saying this works?
namespace ns {
function foo() { }
}
function foo() {}
echo true ? ns:foo():foo();
Looks very confusing to me.
-Rasmus
Just tested that, and yes, it does work. If you think about it though,
this is excellent. A function foo() in my namespace did not clash with a
function foo() in another namespace (in this case, the global
namespace). The confusion here really starts when the user imports the
function foo in namespace ns without an alias (which one should be used,
or should an error be triggered?). This is why I allow the following
syntax in my patch (for both classes and functions):
import function ns:foo as ns_foo; // or whatever you want
Things like these, the appropriate behaviors for different cases, and
scoping issues need to be discussed and a consensus must be reached. I'm
currently listing all the things that I have encountered and that must
be discussed among us all. When I finish, I'll post to the list. Stay
tuned...
Regards,
Jessie
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php