}
} else {
zend_exception_restore(TSRMLS_C);
- zend_exception_error(EG(exception) TSRMLS_CC);
+ zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
}
} else {
- zend_exception_error(EG(exception) TSRMLS_CC);
+ zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
}
}
destroy_op_array(EG(active_op_array) TSRMLS_CC);
}
/* }}} */
-/* This function doesn't return as it calls E_ERROR */
-ZEND_API void zend_exception_error(zval *exception TSRMLS_DC) /* {{{ */
+/* This function doesn't return if it uses E_ERROR */
+ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC) /* {{{ */
{
zend_class_entry *ce_exception = Z_OBJCE_P(exception);
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {
file = zend_read_property(default_exception_ce, exception, "file", sizeof("file")-1, 1 TSRMLS_CC);
line = zend_read_property(default_exception_ce, exception, "line", sizeof("line")-1, 1 TSRMLS_CC);
- zend_error_va(E_ERROR, Z_STRVAL_P(file), Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
+ zend_error_va(severity, Z_STRVAL_P(file), Z_LVAL_P(line), "Uncaught %s\n thrown", Z_STRVAL_P(str));
} else {
- zend_error(E_ERROR, "Uncaught exception '%s'", ce_exception->name);
+ zend_error(severity, "Uncaught exception '%s'", ce_exception->name);
}
}
/* }}} */
extern ZEND_API void (*zend_throw_exception_hook)(zval *ex TSRMLS_DC);
-/* show an exception using zend_error(E_ERROR,...) */
-ZEND_API void zend_exception_error(zval *exception TSRMLS_DC);
+/* show an exception using zend_error(severity,...), severity should be E_ERROR */
+ZEND_API void zend_exception_error(zval *exception, int severity TSRMLS_DC);
/* do not export, in php it's available thru spprintf directly */
int zend_spprintf(char **message, int max_len, char *format, ...);
result = zend_eval_string(str, retval_ptr, string_name TSRMLS_CC);
if (handle_exceptions && EG(exception)) {
- zend_exception_error(EG(exception) TSRMLS_CC);
+ zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
result = FAILURE;
}
return result;
zend_execute(CG(active_op_array) TSRMLS_CC);
if (EG(exception)) {
- zend_exception_error(EG(exception) TSRMLS_CC);
+ zend_exception_error(EG(exception), E_ERROR TSRMLS_CC);
}
CG(active_op_array)->last -= 1; /* get rid of that ZEND_RETURN */
}
if (EG(exception)) {
- zend_exception_error(EG(exception) TSRMLS_CC);
+ zend_exception_error(EG(exception), E_WARNING TSRMLS_CC);
}
php_last_char = '\0';