I need to support some legacy code on a server where I need to be on the latest stable PHP version at all times. I can't possibly update the code base every time I upgrade so I'm wondering if there is a way to run this specific site with an older version of PHP than the one installed.
Example: I'm running PHP 5.3.3 and my code for an old site is broken. It was running perfectly on 5.2.x. Can I simply put a command in at the top of the script(s) to run it as 5.2.x so that I don't have to fix broken code the next time I upgrade to 5.4, 5.5, etc?
TL;DR: Is there a function like this:
exec_as_php_version('5.2.14');//?