I want to run a PHP cli program from within PHP cli. On some machines where this will run, both php4 and php5 are installed. If I run the outer program as
You could use phpversion() to get the current version of PHP before you execute the "inner" script.
phpversion()
http://php.net/manual/en/function.phpversion.php