Date: 09/30/01
- Next message: Derick Rethans: "Re: [PHP-DEV] why does exit() print its argument?"
- Previous message: Zeev Suraski: "Re: [PHP-DEV] exit() and discussion"
- In reply to: Jim Winstead: "Re: [PHP-DEV] why does exit() print its argument?"
- Next in thread: Boian Bonev: "Re: [PHP-DEV] why does exit() print its argument?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Fri, 28 Sep 2001, Jim Winstead wrote:
> On Fri, Sep 28, 2001 at 11:14:04PM +0200, Zeev Suraski wrote:
> > At 22:17 28-09-01, Jason Greene wrote:
> > >Why does exit still set the exit status then?
> >
> > Ok, apparently it does (didn't recall that it does). I'm not sure what the
> > logic behind this is.
>
> so you can have a script that does an exit(1) and things calling that
> script can know that there was some sort of error in the script
> execution.
>
> (personally, i'd love to see exit() stop outputting the status,
> leaving that for die(), but whatever. i know better than to argue for
> consistency with perl. :)
Why not make exit() behaves like this:
exit(2): print nothing, set result status to 2
exit("error"); print "error", set no result.
I.e, on a numeric status, exit with that status, and if it's a string,
just print it. This way almost everybody gets what they want, AND it would
not break much scripts either.
Derick
---------------------------------------------------------------------
PHP: Scripting the Web - www.php.net - derick <email protected>
SRM: Site Resource Manager - www.vl-srm.net
---------------------------------------------------------------------
-- 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>
- Next message: Derick Rethans: "Re: [PHP-DEV] why does exit() print its argument?"
- Previous message: Zeev Suraski: "Re: [PHP-DEV] exit() and discussion"
- In reply to: Jim Winstead: "Re: [PHP-DEV] why does exit() print its argument?"
- Next in thread: Boian Bonev: "Re: [PHP-DEV] why does exit() print its argument?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

