php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18352 exit() always returns 255
Submitted: 2002-07-15 09:42 UTC Modified: 2002-07-23 08:16 UTC
From: tom at scl dot co dot uk Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.2.1 OS: linux 2.2.20
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tom at scl dot co dot uk
New email:
PHP Version: OS:

 

 [2002-07-15 09:42 UTC] tom at scl dot co dot uk
First of all, I know that this is fixed in CVS with Zend 2, and I assume it is fixed on CVS php without Zend 2 BUT, we need a stable version with exit() working properly! So if someone can send a patch or something that would be good enough.

Here's the problem

In the manual it says that if you hand exit() an integer the script will return that value as the exit code and if you hand exit() a string it will print the string (to stderr I think) then exit. When you exit with a string there is no problem and the return code is 255, but when you exit with a number the return code is still 255.

Code to demonstrate the bug:
<?php
exit(5);
?>

This used to work in a version before 4.2.1 (not too sure which) but not it seems to have be broken for 4.2.1

Thanks

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-15 09:46 UTC] edink@php.net
The latest stable snapshot (4.2.2-dev) should be what you're looking for. It only contains bugfixes since the latest release (4.2.1).

http://snaps.php.net/php4-STABLE-latest.tar.gz

 [2002-07-23 06:37 UTC] alatham at flexsys-group dot com
This is still a bug in the 4.2.2 release.
 [2002-07-23 08:16 UTC] yohgaki@php.net
Wait for 4.2.3 or use latest stable CVS snapshot.
Edin means "Wait for 4.2.3".

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat May 18 16:01:36 2024 UTC