From: Bob Weinand Date: Fri, 2 Oct 2015 10:18:26 +0000 (+0200) Subject: Fixed bug #70614 (incorrect exit code in -rr mode with Exceptions) X-Git-Tag: php-7.0.0RC5~5^2~70 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0c03ba0ad0dfb4c5a7d3a1de19545a785be90ed6;p=php Fixed bug #70614 (incorrect exit code in -rr mode with Exceptions) --- diff --git a/NEWS b/NEWS index 1d8768b88b..ec502898cd 100644 --- a/NEWS +++ b/NEWS @@ -2,7 +2,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| 15 Oct 2015, PHP 7.0.0 RC 5 - +- Phpdbg + . Fixed bug #70614 (incorrect exit code in -rr mode with Exceptions). (Bob) 01 Oct 2015, PHP 7.0.0 RC 4 diff --git a/sapi/phpdbg/phpdbg_prompt.c b/sapi/phpdbg/phpdbg_prompt.c index f5341075d0..c16836c872 100644 --- a/sapi/phpdbg/phpdbg_prompt.c +++ b/sapi/phpdbg/phpdbg_prompt.c @@ -649,9 +649,10 @@ static inline void phpdbg_handle_exception(void) /* {{{ */ msg = zval_get_string(zend_read_property(zend_get_exception_base(&zv), &zv, ZEND_STRL("string"), 1, &rv)); } - phpdbg_writeln("exception", "name=\"%s\" file=\"%s\" line=\"" ZEND_LONG_FMT "\"", "Uncaught %s in %s on line " ZEND_LONG_FMT "\n%s", ZSTR_VAL(ex->ce->name), ZSTR_VAL(file), line, ZSTR_VAL(msg)); - zend_string_release(msg); + phpdbg_error("exception", "name=\"%s\" file=\"%s\" line=\"" ZEND_LONG_FMT "\"", "Uncaught %s in %s on line " ZEND_LONG_FMT, ZSTR_VAL(ex->ce->name), ZSTR_VAL(file), line); zend_string_release(file); + phpdbg_writeln("exceptionmsg", "msg=\"%s\"", ZSTR_VAL(msg)); + zend_string_release(msg); if (EG(prev_exception)) { OBJ_RELEASE(EG(prev_exception)); @@ -659,6 +660,8 @@ static inline void phpdbg_handle_exception(void) /* {{{ */ } OBJ_RELEASE(ex); EG(opline_before_exception) = NULL; + + EG(exit_status) = 255; } /* }}} */ PHPDBG_COMMAND(run) /* {{{ */ diff --git a/sapi/phpdbg/tests/exceptions_001.phpt b/sapi/phpdbg/tests/exceptions_001.phpt index d5646ad40d..991ea1cc71 100644 --- a/sapi/phpdbg/tests/exceptions_001.phpt +++ b/sapi/phpdbg/tests/exceptions_001.phpt @@ -16,7 +16,7 @@ prompt> handle first prompt> frame #0: {closure}() at %s:16 frame #1: {main} at %s:20 prompt> 3 -prompt> Uncaught Error in %s on line 16 +prompt> [Uncaught Error in %s on line 16] Error: Call to undefined function foo() in %s:16 Stack trace: #0 %s(20): {closure}() diff --git a/sapi/phpdbg/tests/exceptions_002.phpt b/sapi/phpdbg/tests/exceptions_002.phpt index 6c11c58db6..f304cc25db 100644 --- a/sapi/phpdbg/tests/exceptions_002.phpt +++ b/sapi/phpdbg/tests/exceptions_002.phpt @@ -20,7 +20,7 @@ Stack trace: #1 %s(20): {closure}() #2 {main} thrown in eval()'d code on line 1 -prompt> Uncaught Error in %s on line 16 +prompt> [Uncaught Error in %s on line 16] Error: Call to undefined function foo() in %s:16 Stack trace: #0 %s(20): {closure}()