Namespaces Come to PHP
Back in July, I wrote that the PHP internals team was discussing implementing namespaces in PHP 6. Though still subject to change, the results have been commited to the official version.
Dmitry Stogov and Stanislav Malyshev’s idea is still the leading candidate (because they stepped up and fully implemented it) and but there’s been some discussion over a) whether it’s the right way to go, b) whether it is a “namespace” or actually a “package”. I don’t want to walk into the firing line of either discussion, but as I noted before I’ll cast my vote for any implementation that allows namespaces to envelope blocks of code with curly-braces. (Theirs doesn’t currently.)
If you want to better understand where namespaces may be headed there are two blog posts that can help. The first is “PHP Namespaces (Part 1: Basic usage & gotchas)” by David Coallier. The second is “Namespaces FAQ” by Stanislav Malyshev himself. I suggest reading Coallier’s first to get the basic idea.
The Zend/PHP Conference & Expo is October 8-11 in San Francisco. Both Stogov and Malyshev will be speaking. Even though there isn’t a session about it, I’d expect namespaces to be a major and lively topic of discussion at the event. Maybe a consensus and resolution will come out of it.
