Electricmonk

Ferry Boender

Programmer, DevOpper, Open Source enthusiast.

Blog

PHP Namespaces committed

Friday, July 13th, 2007

Gravitronic lets us know that a patch that implements namespaces in PHP has now been committed.

The last time I took a look at the roadmap for PHP6, it was still undecided if namespaces would make the cut. Seems like they have now (although they could still revert the commit, like they did with namespaces in PHP5 if I recall correctly).

The main idea of the proposal is to attack one target and this target only – the Super_Long_Really_Annoying_Enormous_Class_Names that lately became the bane of big project developer. All other things are considered secondary to this goal – no attempt to make some different include model, packaging model, etc.
Namespaces – can we keep it simple?

Some examples of how it currently works:

Defining namespaces


Referring by full namespace name


Importing


Though I can't quite put my finger on it, it somehow still seems like a bolt-on to me. Ah well, better than nothing, right?

The text of all posts on this blog, unless specificly mentioned otherwise, are licensed under this license.