My 2 cents...

I think "exit" should be fixed as you describe...

And I think "die" should behave as it does in perl
which is to print out whatever it is passed.


--- Jani Taskinen 
-----  Question: Should exit() print out the integer exit-status?
-----  Wed, 19 Dec 2001 01:38:39 +0200 (EET)

background information:

exit() function is broken. Fixing the broken behaviour is the
only real solution, IMO.

One solution:

- When passed argument is string: print out this string
- When passed argument is integer: Don't print it, use it as exit-status

This is what is the expected behaviour is and I really can't think
of any good examples where this would fail. Nobody ever gave any.
And to get the REAL users (not only Zeev's opinion) I'm sending
this also to php-general.

>From manual:

"The exit() function terminates execution of the script. It prints
status just before exiting. If status is an integer, that value will be
used as exit-status."

This can be understood in many ways. If the status is integer,
it is used as exit-status..but it's not clear that it's ALSO printed out
which is simply buggy behaviour.

Now, if general concencus amongs the users of PHP is that it should
also print out the exit-status when it's an integer then 'shell_exit()'
function should be added.


PHP General Mailing List (
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to