Re: Re: cvs: php4 /main main.c /sapi/cgi cgi_main.c /sapi/cli php_cli.c /sapi/pi3web pi3web_sapi.c

From: Date: Fri, 15 Feb 2002 08:58:56 +0000
Subject: Re: Re: cvs: php4 /main main.c /sapi/cgi cgi_main.c /sapi/cli php_cli.c /sapi/pi3web pi3web_sapi.c
References: 1  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-9385@lists.php.net to get a copy of this message
At 09:49 AM 2/15/2002 +0100, Derick Rethans wrote:
On Fri, 15 Feb 2002, Andi Gutmans wrote: At 09:25 AM 2/15/2002 +0100, derick@php.net wrote:
On Fri, 15 Feb 2002, Andi Gutmans wrote:
At 08:47 PM 2/14/2002 -0600, Andrei Zmievski wrote:
Andi Gutmans wrote:
Exit status == -1 doesn't sound right to me. They can range
from 0-255.
That will only be set if there is a parse error, so I think it's safe.
It has nothing to do with safe. exit() return values should be between 0-255. As we know this then why not do it right?
Which exit value do you suggest then?
255? Fine with me... but I wonder what this snippet is doing then (in the same function:
    } zend_catch {
        exit_status = -1;
    } zend_end_try();
First of all I think the author meant for this to be exit_status = FAILURE; because exit_status is set to SUCCESS earlier in the code. (I think this approach is wrong because it's the exit status and theoretically the values of SUCCESS/FAILURE could change sometime in the future). It would be most correct to set exit_status to 0 in the beginning and then if there's a failure set it to the value we choose. The only reason why I preferred something else over -1 is because it's more correct and helps people later on understand what return value is reserved by PHP. If -1 translates to 255 you'd probably want to mention in the PHP manual that 255 is reserved for PHP and shouldn't be used by script writers. Andi

« previous php.cvs (#9385) next »