php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #62294 register_shutdow_function() does not handle correctly exit code
Submitted: 2012-06-11 15:02 UTC Modified: -
Votes:12
Avg. Score:4.5 ± 0.6
Reproduced:10 of 10 (100.0%)
Same Version:10 (100.0%)
Same OS:5 (50.0%)
From: frederic dot hardy at mageekbox dot net Assigned:
Status: Open Package: Scripting Engine problem
PHP Version: 5.4.3 OS: Mac OS X
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2012-06-11 15:02 UTC] frederic dot hardy at mageekbox dot net
Description:
------------
When a fatal error is throwed in a callback used with 
register_shutdown_function(), php exit code is 0 instead of 255.
There is no problem with PHP < 5.4

Test script:
---------------
<?php

register_shutdown_function(function()
		{
			require 'path/to/an/unknown/file';
		}
);

Expected result:
----------------
# php testScript.php
# echo $?
255

Actual result:
--------------
# php testScript.php
# echo $?
0

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Dec 09 13:01:24 2019 UTC