Skip to content

Namespaces in PHP

Dear Reader,

I don’t often comment on PHP directly in my blog as I have other outlets for that. However, Elizabeth Smith brought this post to my attention yesterday in the #phpc chatroom and I really think it deserves a mention by any and all interested in this topic. (Also, this post is on my personal blog and should not in any way be considered a corporate endorsement for any person or idea discussed…you have been warned.)

If you don’t follow the PHP internals mailing list, then you may not know of the storm that has been playing out in it regarding namespaces in PHP 5.x or PHP 6. Don’t worry, if you don’t follow it, unless you are qualified to participate in the discussion, it’s really not that interesting. The important fact is that there has been for some time now, a very passionate discussion over how namespaces should be implemented in PHP, when they should be implemented and should they even be implemented in PHP.

Deric Rethans even wrote an interesting and detailed message titled “RFC Dropping Namespaces“, which shows you how far this conversation has gone.

To the point of this post, on Thursday, Greg Beaver wrote a rebuttal to Derick’s post. Not only did he address all of Derick’s concerns but he suggested how they could be addressed technically. (Not being a regular follower of internals, it is only by anecdotal evidence that I understand that it is not common for someone to rebut AND suggest a solution at the same time.)

Kudos to Greg for what seems to be a comprehensive and viable solution. (At least from my limited understanding of the problem space.) If you are at all interested in the future of PHP, I suggest you go take a look at the discussion as it may affect you. (Please though, no +1 posts and unless you are ready to show a patch to support your idea of how it should be implemented, please don’t post your idea)

Until next time,