Cover image for post I love namespaces

I love namespaces

While I have been waiting for namespaces support in PHP since the early days of PHP 5, the recent proposal by Dmitry looks very promising to me. I really like the way, namespaces are defined and used. Especially the use of "::" for namespaces. This way of handling them looks much more intuitive than any other operator proposed so far (yes, I know, characters don't matter). I did not dig into internals of this proposal, but the post about it seems to be well-thought and the concept looks promising.

So, it's now up to you internals guys, to say: "Cool, let's go with it" and make a huge lot of PHP users happy! :)


Agreed. His post did look very well thought out and I would love to see this implemented in PHP6. I think it would help keep things cleaner in many of the PHP Frameworks out there, as well as help keep custom jobs cleaner.

I know there are ways to create 'faux' namespaces - but this would be a much better solution to the problem.

Nate Klaiber at 2007-07-06

My C is too rusty to know how feasible or practical it is, but I would just like to see the ability to define classes within other classes. Add that in, with scope, and let us access them like statics and I'm happy.

We'd have namespaces without just creating a one dimensional wrapper around a class.

Travis Swicegood at 2007-07-10

It is good way! Namespaces rulez :)

stormfly at 2007-07-19