PHP 4.0 Bug #4587 Updated: Would like exit and die to return an int
| From: | jeff_schnitter at peoplesoft dot com | Date: | Fri, 02 Mar 2001 17:47:33 +0000 |
| Subject: | PHP 4.0 Bug #4587 Updated: Would like exit and die to return an int | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-47815@lists.php.net to get a copy of this message | ||
ID: 4587
User Update by: jeff_schnitter@peoplesoft.com
Status: Open
Bug Type: Feature/Change Request
Description: Would like exit and die to return an int
Any update on this request? Is there an existing way in the language that I can force a non-zero
return code to be passed back to the OS?
Previous Comments:
---------------------------------------------------------------------------
[2000-05-24 21:10:44] jeff_schnitter@peoplesoft.com
I think PHP is awesome. I am a build engineer and am going to replace all of my shell scripts and
perl scripts with PHP. One thing that is currently hurting me is that exit and die do not return a
value.
If I have a makefile with a target, and I run a PHP script to build that target, I want the PHP
script to return a value. That way, make will behave properly.
all: target1 target2
target1:
php -q -f script1.php
target2:
php -q -f script2.php
If script1.php does not execute successfully, I do not want script2.php to run.
This problem isn't limited to make. If I have stand alone scripts that are called from other
external programs, it is extremely important to be able to pass back a return code.
If it causes too much of a problem to change the signature of the exit and die functions, I'd
be perfectly happy if there was a new function that did exit with a return code,
ie
int exit_rc(int value)
Thanks for your consideration and thanks for a great language!
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=4587