Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

Bug 97490

Summary: exit() and return() broken
Product: [Retired] Red Hat Linux Reporter: Byron Clark <byronc>
Component: phpAssignee: Joe Orton <jorton>
Status: CLOSED DUPLICATE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 9   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-02-21 18:56:45 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Byron Clark 2003-06-16 16:41:14 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4b) Gecko/20030614
Mozilla Firebird/0.6

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):
php-4.2.2-17

How reproducible:
Always

Steps to Reproduce:
1. Create a file called exit_test.php with this text:
#!/usr/bin/php -q
<?
   exit(0);
?>

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

Additional info:

Comment 1 Joe Orton 2003-06-16 19:51:05 UTC

*** This bug has been marked as a duplicate of 84828 ***

Comment 2 Red Hat Bugzilla 2006-02-21 18:56:45 UTC
Changed to 'CLOSED' state since 'RESOLVED' has been deprecated.