com php-src: Fix CLI test and drop some now unnecessary code: main/main.c sapi/cli/tests/bug43177.phpt
| From: | Nikita Popov | Date: | Mon, 09 Mar 2015 13:09:34 +0000 |
| Subject: | com php-src: Fix CLI test and drop some now unnecessary code: main/main.c sapi/cli/tests/bug43177.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-85406@lists.php.net to get a copy of this message | ||
Commit: b0055678bf53608f440d074d9acee49b03dabfc0
Author: Nikita Popov <nikic@php.net> Mon, 9 Mar 2015 14:08:01 +0100
Parents: 1c94ff0595bbe6f3df8058aff7252bda09dc4a15
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b0055678bf53608f440d074d9acee49b03dabfc0
Log:
Fix CLI test and drop some now unnecessary code
Changed paths:
M main/main.c
M sapi/cli/tests/bug43177.phpt
Diff:
diff --git a/main/main.c b/main/main.c
index ffbead8...14f86b0 100644
--- a/main/main.c
+++ b/main/main.c
@@ -1186,29 +1186,11 @@ static void php_error_cb(int type, const char *error_filename, const uint
error_
case E_PARSE:
case E_COMPILE_ERROR:
case E_USER_ERROR:
- { /* new block to allow variable definition */
- /* eval() errors do not affect exit_status or response code */
- zend_bool during_eval = 0;
-
- if (type == E_PARSE) {
- zend_execute_data *execute_data = EG(current_execute_data);
-
- while (execute_data && (!execute_data->func ||
!ZEND_USER_CODE(execute_data->func->common.type))) {
- execute_data = execute_data->prev_execute_data;
- }
-
- during_eval = (execute_data &&
- execute_data->opline->opcode == ZEND_INCLUDE_OR_EVAL &&
- execute_data->opline->extended_value == ZEND_EVAL);
- }
- if (!during_eval) {
- EG(exit_status) = 255;
- }
+ EG(exit_status) = 255;
if (module_initialized) {
if (!PG(display_errors) &&
!SG(headers_sent) &&
- SG(sapi_headers).http_response_code == 200 &&
- !during_eval
+ SG(sapi_headers).http_response_code == 200
) {
sapi_header_line ctr = {0};
@@ -1229,7 +1211,6 @@ static void php_error_cb(int type, const char *error_filename, const uint
error_
}
}
break;
- }
}
/* Log if necessary */
diff --git a/sapi/cli/tests/bug43177.phpt b/sapi/cli/tests/bug43177.phpt
index a97769c..c0a8da4 100644
--- a/sapi/cli/tests/bug43177.phpt
+++ b/sapi/cli/tests/bug43177.phpt
@@ -11,7 +11,10 @@ php_cli_server_start(<<<'SCRIPT'
ini_set('display_errors', 0);
switch($_SERVER["REQUEST_URI"]) {
case "/parse":
- eval("this is a parse error");
+ try {
+ eval("this is a parse error");
+ } catch (ParseException $e) {
+ }
echo "OK\n";
break;
case "/fatal":