Re: [PHP-DEV] Bug #11008 Updated: exit() should return an exit statusif passed, not send to stdout

2001-12-06 Thread Jani Taskinen


I can't remember every single war there has been on php-dev.. :-p
Like Jason put it, two GOOD solutions (others are just denying the fact
that someone fucked this up when it was implemented):

1. Overload it.
2. Separate die() and exit().

Zeev, are you really using exit() to output integers?
What kind of script is it? (just curious)

Maybe we should ask on php-general sometimes when we get into
discussion whether people rely on something or not? :)
Or put up some kind of voting thing on php.net which can be used
to find out what the people 'out there' think ?

--Jani


On Fri, 7 Dec 2001, Markus Fischer wrote:

>On Fri, Dec 07, 2001 at 02:33:50AM +0200, Jani Taskinen wrote :
>>
>> Creating some new function (or language construct :) and not fixing the
>> existing one is really stupid idea.
>>
>> exit(string) -> same behaviour as before
>> eixt(int)-> only set exit-status and no echo out anything to stdout.
>>
>> Thus BC wouldn't be that badly broken..
>
>Here are the relevant archive references:
>
>http://marc.theaimsgroup.com/?t=10017029302&w=4&r=1
>http://marc.theaimsgroup.com/?l=php-dev&m=99539268507735&w=4
>
>- Markus
>
>


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP-DEV] Bug #11008 Updated: exit() should return an exit statusif passed, not send to stdout

2001-12-06 Thread Jani Taskinen


Creating some new function (or language construct :) and not fixing the
existing one is really stupid idea.

exit(string) -> same behaviour as before
eixt(int)-> only set exit-status and no echo out anything to stdout.

Thus BC wouldn't be that badly broken..

--Jani


On Fri, 7 Dec 2001, Markus Fischer wrote:

>Sadly no :-/ There were some discussions in the past and some
>ideas came up (exit_shell() or shell_exit()) but no further
>steps where taken.
>
>- Markus
>
>On Thu, Dec 06, 2001 at 10:02:53PM -, [EMAIL PROTECTED] wrote :
>> ID: 11008
>> Updated by: sniper
>> Reported By: [EMAIL PROTECTED]
>> Old Status: Closed
>> Status: Analyzed
>> Bug Type: Scripting Engine problem
>> Operating System: Linux
>> PHP Version: 4.0 Latest CVS (2001-05-21)
>> New Comment:
>>
>> I just got bitten by this. The manual page says that if the value passed
>> to exit() is integer it is used as exit status.
>>
>> Or is there some other way to exit from PHP script with an exit status?
>>
>> --Jani
>>
>>
>> Previous Comments:
>> 
>>
>> [2001-07-15 16:43:19] [EMAIL PROTECTED]
>>
>> Simply put - no, it should not.
>>
>> exit's optional argument is a termination message, not a shell status.
>>
>> 
>>
>> [2001-05-23 11:24:22] [EMAIL PROTECTED]
>>
>> Anyone in the Zend core want to comment on this?  I know where the code is that 
>does it.  But it is in the Zend code.
>>
>> Is there a good reason to put this exit status to stdout?
>>
>> 
>>
>> [2001-05-22 01:59:53] [EMAIL PROTECTED]
>>
>> indeed it does both:
>>
>> if php; then echo yes; fi
>> 
>> X-Powered-By: PHP/4.0.5
>> Content-type: text/html
>>
>> 0yes
>>
>> if php; then echo yes; fi
>> 
>> X-Powered-By: PHP/4.0.5
>> Content-type: text/html
>>
>> 1
>>
>> i don't see a real reason for the echoed exit status though
>>
>> 
>>
>> [2001-05-21 21:34:23] [EMAIL PROTECTED]
>>
>> Working with a shell script here.  I hoped that exit() would work like perl and 
>return the passed status as and exist status.  As it stands now, it sends it to 
>stdout.  This is unexpected.
>>
>> It would be much more useful if exit() could be used to enable the use of PHP in 
>shell scripts by returning the passed value as an exit status.
>>
>> 
>>
>>
>>
>> Edit this bug report at http://bugs.php.net/?id=11008&edit=1
>>
>>
>> --
>> PHP Development Mailing List 
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]