Re: Question: Should exit() print out the integer exit-status?

From: Date: Wed, 19 Dec 2001 14:39:40 +0000
Subject: Re: Question: Should exit() print out the integer exit-status?
References: 1 2 3 4 5  Groups: php.dev 
Request: Send a blank email to php-dev+get-74406@lists.php.net to get a copy of this message
At 16:11 19/12/2001, Lars Torben Wilson wrote:
Zeev Suraski writes: At 15:15 19/12/2001, Lars Torben Wilson wrote:
Zeev Suraski writes:
exit_with_status(), silent_exit(), quiet_exit(), etc. etc. Something should fit :)
Yeah, you could do that. But then, why don't we have a 'c_compatible_dirname()' now, instead of a proper dirname() patch which has been proven to break BC? Because the new version is Correct--at least according to programming tradition. (Sorry, Manuel.) A function named exit(), which accepts an argument, is just _expected_ to set the exit status (assuming the coder has coded in other languages before). A better solution IMHO would be to make exit() do the right thing and create a new function named something like 'exit_print()' which behaves the way the current exit() does. Besides, as Vlad pointed out it's a _hell_ of a lot easier to do the print-out thing in userland than it is to set the exit status. :)
It's not about whether or not it's easy or not - we're not at the stage of designing the language behavior from scratch now... There's a fundamental difference between dirname(), which is supposed to answer the question of 'what directory does this file sit in?' - and there's only one correct answer. The old dirname() had a bug, period. What a function named exit() does is entirely up to us. Of course, it's expected to terminate execution by its very name, but it may do other things too, such as set the OS error code, print out an error message, etc. Perhaps I have not explained my position. I don't care whether it outputs the exit status as a string--as long as it sets the error code appropriately *as well*.
AFAIR, this is the way it works now... Zeev

Thread (53 messages)

« previous php.dev (#74406) next »