Red Hat Bugzilla – Bug 97490
exit() and return() broken
Last modified: 2007-04-18 12:54:51 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030614
Description of problem:
When exit() or return() is used to exit a program, the return value for the
program is not correct. When exit() is used, the return value will always be
255 regardless of the value passed to it. When return() is used, the return
value will always be 0 regardless of the value passed to it.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. Create a file called exit_test.php with this text:
2. chmod +x exit_test.php
3. ./exit_test.php; echo $?
4. return has a similar problem. return(255) will exit with a return value of 0.
Actual Results: The output is 255
Expected Results: Ouput should have been 0
*** This bug has been marked as a duplicate of 84828 ***
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.