PHP 5.3 has hit Alpha 3 now, so it was about time I got around to poking at the new features myself, instead of just glancing over and deleting huge flame wars on the internals list of the minutae of the much, er, ‘discussed’ namespaces implementation.
If you’re running WIndows, they have builds for you, but the rest of us instead get to build from source. This was slightly tricky:
1. get the php sources here:
2. if you intend to compile in MySQL support, make sure you have some mysql headers and such around. For me on OS X, this got funky as the layout for the mysql5-devel port MacPorts provides does not layout the lib and include directories in the way that the plain-jane PHP sources expect. Luckily I found this post:
Read the post-extract section of the mysql5 variant of the php5 portfile to see how it copes with this. You just have to make a couple symlinks to make the layout match what php expects. You could:cd /tmp
ln -s /opt/local/lib/mysql5 php5mysql5/lib
ln -s /opt/local/include/mysql5 php5mysql5/include
Then use –with-mysql=/tmp/php5mysql5 in your php configure line instead. Then delete /tmp/php5mysql5 when you’re done.
This got me a build of PHP 5.3 with the plain ol’ mysql extension, but I did run into problems with pdo-mysql. No matter, just mysql will do for testing. Using pecl I installed xdebug, pointed Komodo at the new interpreter and had the basics working.
3. IBM has a great series of articles on the new features: