]> granicus.if.org Git - php/commitdiff
Fixed bug #62725 (Calling exit() in a shutdown function does not return the exit...
authorXinchen Hui <laruence@php.net>
Thu, 2 Aug 2012 15:03:38 +0000 (23:03 +0800)
committerXinchen Hui <laruence@php.net>
Thu, 2 Aug 2012 15:03:38 +0000 (23:03 +0800)
The fix is make 5.4 behavior consistent with 5.3

NEWS
sapi/cli/php_cli.c

diff --git a/NEWS b/NEWS
index 6b0d2d94be572c14cd7f018741973c4e7a644d6a..623a791b4e7501d248f8db0cf5164a089204e2de 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,10 @@ PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2012, PHP 5.4.7
 
+- Core:
+  . Fixed bug #62725 (Calling exit() in a shutdown function does not return
+    the exit value). (Laruence)
+
 - PDO:
   . Fixed bug #62685 (Wrong return datatype in PDO::inTransaction()). (Laruence)
 
index 2cdd1aac6d3edd9d05b4d151536d4220fe19b9c6..f9bf3ee60bd8e7d78f695b74a025988683bdf9e7 100644 (file)
@@ -1167,15 +1167,15 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
        } zend_end_try();
 
 out:
-       if (exit_status == 0) {
-               exit_status = EG(exit_status);
-       }
        if (request_started) {
                php_request_shutdown((void *) 0);
        }
        if (translated_path) {
                free(translated_path);
        }
+       if (exit_status == 0) {
+               exit_status = EG(exit_status);
+       }
        return exit_status;
 err:
        sapi_deactivate(TSRMLS_C);