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};
}
}
break;
- }
}
/* Log if necessary */
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":