php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65275 Calling exit() in a shutdown function does not change the exit value in CLI
Submitted: 2013-07-16 17:44 UTC Modified: 2013-07-17 14:56 UTC
Votes:4
Avg. Score:4.2 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: david at grudl dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: Irrelevant OS:
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: david at grudl dot com
New email:
PHP Version: OS:

 

 [2013-07-16 17:44 UTC] david at grudl dot com
Description:
------------
This code is exited with error code 111 in CGI, but under CLI the error code remains 255.

register_shutdown_function(function(){
	die(111);
});

die(255);


This bug is similar to https://bugs.php.net/bug.php?id=62725, but there is big difference between die(0) and die(255). 






Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-07-16 17:50 UTC] david at grudl dot com
(btw numbers #65275 and #62725 are similar too :-)
 [2013-07-17 14:56 UTC] laruence@php.net
the problem here is, we don't know whether there was a new exit_status set to 
EG(exit_status) in request_shutdown phase..
 [2020-08-10 10:40 UTC] nikic@php.net
Automatic comment on behalf of nikita.ppv@gmail.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7c3e487289ec41e560cf7a77e36eb43da2234f33
Log: Fixed bug #65275
 [2020-08-10 10:40 UTC] nikic@php.net
-Status: Open +Status: Closed
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sat Apr 19 00:01:26 2025 UTC