David Parra has posted his method for getting the latest version of PHP compiled under a machine running OpenSolaris.
As I switched my main system recently from Linux to OpenSolaris I compiled PHP. Quiet obvious things are a little bit different on Solaris. The usual ./buildconf && ./configure && make install doesn't work anymore. The good news: It's not much harder.
A few extra packages are required (like SUNWgmake, SUNWgcc and SUNWbison) and the Re2c library, but after that, it's just like a normal install. All commands needed to make the build are included in the post.