Re: Question: Should exit() print out the integer exit-status?
| From: | php4 at developersdesk dot com | Date: | Wed, 19 Dec 2001 20:28:19 +0000 |
| Subject: | Re: Question: Should exit() print out the integer exit-status? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-74495@lists.php.net to get a copy of this message | ||
Just a thought...
-------------------------------------------------------------------
void exit ( [mixed message[, int return_value]])
Note: This is not a real function, but a language construct.
The exit() function terminates execution of the script. Message
must be a string or an int. If a non-null message is given it is
printed just before exiting. If return_value is given the exit status
of the program is set to this value. To set an exit status without
printing anything, pass "" as message.
exit(); end program, print nothing, return 0
exit( "message" ); end program, print message, return 0
exit( 5 ); end program, print 5, return 0
exit( "messge", 5 ); end program, print message, return 5
exit( 6, 5 ); end program, print 6, return 5
exit( "", 5 ); end program, print nothing, return 5
NOTE: The last example does not print _anything_. No <BR>'s no \n's...
nothing.
-------------------------------------------------------------------
That should preserve BC and let those of us who are using php for shell
scripting to have a reasonably simple way to return program status with
or without printing message.
Rick
Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com