I was able to duplicate this as written above. Two notes though:
1)
passthru() will work as described above, but the the value stored in the $result will be the exit status of the program. If it is not zero, the program did not run. If it is 127, it could not find the program. As well,
passthru() is typically used for binary or raw data: use
exec('command','output var','return code') to store the data retrieved form the executed command and
system('command','return code') to print
string data out as retrieved.
2) the results of those commands are affected by the INI_SYSTEM values of
safe_mode and
safe_mode_exec_dir. If
safe_mode is set to yes, executable are only allowed in the
safe_mode_exec_dir.
Edit by castaway: Closed small tag in signature