summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_execute.h2
-rw-r--r--Zend/zend_execute_API.c9
2 files changed, 11 insertions, 0 deletions
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index 3f5d5cc4f8..db33969251 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -65,6 +65,8 @@ ZEND_API int zend_lookup_class(char *name, int name_length, zend_class_entry ***
ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSRMLS_DC);
ZEND_API int zend_eval_string_ex(char *str, zval *retval_ptr, char *string_name, int handle_exceptions TSRMLS_DC);
+ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC);
+
static inline int i_zend_is_true(zval *op)
{
int result;
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 02d8e8bae7..ee1d88ca68 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -1221,6 +1221,15 @@ void zend_throw_exception_internal(zval *exception TSRMLS_DC)
EG(current_execute_data)->opline = &EG(active_op_array)->opcodes[EG(active_op_array)->last-1-1];
}
+ZEND_API void zend_throw_exception_object(zval *exception TSRMLS_DC)
+{
+ if (exception == NULL) {
+ zend_error(E_ERROR, "Need to supply object when throwing exception");
+ }
+ zend_throw_exception_internal(exception TSRMLS_CC);
+}
+
+
ZEND_API void zend_clear_exception(TSRMLS_D)
{