Re: why does exit() print its argument?
| From: | Zeev Suraski | Date: | Sat, 29 Sep 2001 21:24:01 +0000 |
| Subject: | Re: why does exit() print its argument? | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-66837@lists.php.net to get a copy of this message | ||
I wouldn't be surprised if it broke lots of code. I, for once, have been using it a lot, even though I'm primarily a C coder. Considering PHP is a Web scripting language, I think that the chances of people expecting this to have something to do with processes is very small, since in the vast majority of PHP installation, that's completely meaningless.
We must not break compatibility unless there's a very good reason to do it, and there simply isn't.
Zeev
At 20:53 29-09-01, Sander Steffann wrote:
Hi, How about if we overload it a bit. I think anybody who does exit(1) is expecting 1 to be set as the return status True, exit is the 'expected' name for this behaviour IMHO. whereas someone who does exit('something bad happened') is expecting the string to be shown a-la die(). So let's just check the arg and do the appropriate thing. I would be very surprised if that broke anything. You could do this, but I don't think it is ..realy.. needed. It would make the function a little more complicated to understand, but it wouldn't break backwards compatibility as much. I am for changing exit() to do the 'expected' thing, and break a 'little' backwards compatibility. Usualy I am very much against breaking backwards compatibility, but in this case I think it's the best thing to do... Because: - It's already documented that way - It's the 'expected' behaviour (from other languages, and from the docs) As Rasmus said: It would be surprising if this broke a lot of (or even any) code. Sander. -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net