Return value in PHP shell script
Posted: Sat Jan 18, 2003 3:05 pm
Hello.
I do require a way to return values from a php script which is used as a shell script on a linux system.
Assume the following file 'test.php':
If I now execute the following line at the command line:
./test.php && echo Hello
it indeed does execute the echo call as well although I do return 0 from the script. So I assume that returning a value from the global namespace does not determine the value returned by the php script interpreter.
However, I du actually require this behaviour as I indent to use a PHP script in a .qmail file which changes processing behaviour depending on the return values of the executables.
I do use the PHP 4.3.0
I hope you can help me with that.
Thanks in advance,
Alex
I do require a way to return values from a php script which is used as a shell script on a linux system.
Assume the following file 'test.php':
Code: Select all
#!/usr/local/sbin/php -q
<?php
return 0;
?>./test.php && echo Hello
it indeed does execute the echo call as well although I do return 0 from the script. So I assume that returning a value from the global namespace does not determine the value returned by the php script interpreter.
However, I du actually require this behaviour as I indent to use a PHP script in a .qmail file which changes processing behaviour depending on the return values of the executables.
I do use the PHP 4.3.0
I hope you can help me with that.
Thanks in advance,
Alex