Re: [PHP-DEV] why does exit() print its argument? From: Sander Steffann (sander <email protected>)
Date: 09/29/01

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 <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>