diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 09f16410475..fa94b3e09f5 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -585,7 +585,10 @@ static int _preg_do_eval(char *eval_str, char *subject, int *offsets, } /* Run the code */ - zend_eval_string(code, &retval CLS_CC ELS_CC); + if (zend_eval_string(code, &retval CLS_CC ELS_CC) == FAILURE) { + zend_error(E_ERROR, "Failed evaluating code:\n%s\n", code); + /* zend_error() does not return in this case */ + } convert_to_string(&retval); /* Save the return value and its length */ diff --git a/ext/standard/assert.c b/ext/standard/assert.c index e9a0417a123..b55239c3ce4 100644 --- a/ext/standard/assert.c +++ b/ext/standard/assert.c @@ -160,7 +160,10 @@ PHP_FUNCTION(assert) EG(error_reporting) = 0; } - zend_eval_string(myeval, &retval CLS_CC ELS_CC); + if (zend_eval_string(myeval, &retval CLS_CC ELS_CC) == FAILURE) { + zend_error(E_ERROR, "Failure evaluating code:\n%s\n", myeval); + /* zend_error() does not return in this case. */ + } if (ASSERT(quiet_eval)) { EG(error_reporting) = old_error_reporting;