I heavily recommend PHP farm to test your code with a given version of PHP:
http://cweiske.de/tagebuch/Introducing%20phpfarm.htm
This allows you to have several versions of PHP, each one with a given php.ini, given list of extensions and a given PEAR.