Re: Why there's no namespace keyword in php5?




another benefit of being able to use namespaces is providing another
layer of encapsulation, defining visibility for classes, hiding
unneeded info from the namespaces different than the current.

I think that's more important than the name collision. About the
naming,using frameworks or 3rd party modules etc. results in name
collisions most of the time, and working as a team may result in weird
names.
Eg. Namespace A
{
private class B
{}
public Class c
}
Namespace D
{
private class E
{
instC=new C(); // OK
instB=new B(); // Not Accessible
}
}

.



Relevant Pages

  • Re: Namespaces in PHP5, removed?
    ... > where you link in binary libraries and there's no other workaround for name ... With PHP you can just rename the class/function. ... know that a name collision exists to begin with. ... alternative to namespaces is a class naming convention, ...
    (comp.lang.php)
  • Re: Index a #define string
    ... in *many* cases the language provides superior alternatives. ... >> organize names, but they do not, at a language level, protect them. ... >> The only things that stop name collision are ... > Namespaces do not exist to protect from name collisions. ...
    (comp.lang.cpp)
  • Re: Cant use using in method???
    ... Namespaces prevent name ... collision. ... but I'm finding all sorts of problems w/ the global using ... I think you'll find you either change your mind quickly, ...
    (microsoft.public.dotnet.languages.csharp)