Bug #18027 Updated: exit(0) in command-line use produces 255
| From: | derick@php.net | Date: | Thu, 27 Jun 2002 21:30:17 +0000 |
| Subject: | Bug #18027 Updated: exit(0) in command-line use produces 255 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-12268@lists.php.net to get a copy of this message | ||
ID: 18027
Updated by: derick@php.net
Reported By: befletch@yahoo.com
-Status: Open
+Status: Closed
Bug Type: Feature/Change Request
Operating System: OpenBSD 3.1
PHP Version: 4.2.1
New Comment:
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a
documentation
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2002-06-27 17:26:15] befletch@yahoo.com
Consider the following command line script:
#!/usr/local/bin/php -q
<?php
exit( 0 );
?>
With PHP 4.1.2, this returned 0 to the calling
process (e.g. the $? shell variable). With
PHP 4.2.1, this no longer works - exit(0) returns
255.
I don't know if this is intentional or not, but
now the only way I can use 0 for success and !0
for errors is:
$return_val = whatever();
if ( $return_val === 0 )
return 0;
else
exit( $return_val );
Can this be returned to the older way of doing
things?
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18027&edit=1