This is weird to me. I wonder why. I wrote a PHP script to validate syntax of another PHP script named test.php
<?php
print("Hello World");
?>
The validating script index.php is:
#!/usr/bin/env php
<?php
exec("php -l test.php", $error, $retcode);
echo($retcode . "<br />");
var_dump($error);
?>
When I run on command line php index.php, it generates this output:
0<br />array(1) {
[0]=>
string(37) "No syntax errors detected in test.php"
}
This looks good to me. However, when I run on localhost it generates this output:
#!/usr/bin/env php 5
array(0) { }
Why $retcode is set to 5? Also, I'm on PHP5.3