Bug #17107: exit() always reports exit status=255

From: Date: Thu, 09 May 2002 01:44:50 +0000
Subject: Bug #17107: exit() always reports exit status=255
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-7279@lists.php.net to get a copy of this message
From: phpbug@robin.pfft.net Operating system: Linux PHP version: 4.2.0 PHP Bug Type: Scripting Engine problem Bug description: exit() always reports exit status=255 $ php -v 4.2.0 $ php -q <?php exit(5); ?> $ echo $? 255 exit(n) always reports 255 (or -1) as exit status to the OS, regardless of the value it is passed as argument. The correct behavior according to the documentation would be to report n as exit status, or echo n if n is a string. The only workaround I could find is to use return from the global scope. Thank you :) -- Edit bug report at http://bugs.php.net/?id=17107&edit=1 -- Fixed in CVS: http://bugs.php.net/fix.php?id=17107&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=17107&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=17107&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=17107&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=17107&r=support Expected behavior: http://bugs.php.net/fix.php?id=17107&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=17107&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=17107&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=17107&r=globals

« previous php.bugs (#7279) next »