3 ms·
It doesn't change the fact that, the way you're suggesting, I cannot have both a namespace and class named foo in the global scope or within the same namespace.
by encoderer 17y ago
It doesn't change the fact that, the way you're suggesting, I cannot have both a namespace and class named foo in the global scope or within the same namespace.
if I did, I'd see the same ambiguity the PHP internals developers were discussing.
And spin it however you'd like, having a namespace conflict with a classname is far more confusing than trying to wrap your head around this (apprently) insanely complex use of the backslash operator as a namespace delimiter.
- wvenable 17y agoI cannot have both a namespace and class named foo in the global scope or within the same namespace. Yes, but you make that sound like a bad thing. In real life, having classes and namespaces with the same names would not be good. Nobody is going to do it, so why support it? Can you think of an example where it makes sense to have a class and namespace with the same name? And spin it however you'd like, having a namespace conflict with a classname is far more confusing Really? Because that's how every other language works from Java, C#, C++, Perl, etc. If you didn't know that, it's probably not such a big deal.