Bug #18027: exit(0) in command-line use produces 255

From: Date: Thu, 27 Jun 2002 21:26:15 +0000
Subject: Bug #18027: exit(0) in command-line use produces 255
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-12267@lists.php.net to get a copy of this message
From: befletch@yahoo.com Operating system: OpenBSD 3.1 PHP version: 4.2.1 PHP Bug Type: Feature/Change Request Bug description: exit(0) in command-line use produces 255 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 bug report at http://bugs.php.net/?id=18027&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=18027&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=18027&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=18027&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=18027&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=18027&r=support Expected behavior: http://bugs.php.net/fix.php?id=18027&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=18027&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=18027&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=18027&r=globals

« previous php.bugs (#12267) next »