From 5a99c07eccb09c3c8b9f6fe4b83020163aad6498 Mon Sep 17 00:00:00 2001 From: Aaron Piotrowski Date: Fri, 3 Jul 2015 13:41:17 -0500 Subject: Enable throwing custom exceptions from errors --- Zend/zend_objects.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Zend/zend_objects.c') diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c index 6dc1a2d076..cc26aa98d9 100644 --- a/Zend/zend_objects.c +++ b/Zend/zend_objects.c @@ -93,7 +93,7 @@ ZEND_API void zend_objects_destroy_object(zend_object *object) if (object->ce != EG(scope)) { zend_class_entry *ce = object->ce; - zend_error(EG(current_execute_data) ? E_EXCEPTION | E_ERROR : E_WARNING, + zend_throw_error(zend_ce_error, EG(current_execute_data) ? E_EXCEPTION : E_WARNING, "Call to private %s::__destruct() from context '%s'%s", ZSTR_VAL(ce->name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : "", @@ -106,7 +106,7 @@ ZEND_API void zend_objects_destroy_object(zend_object *object) if (!zend_check_protected(zend_get_function_root_class(destructor), EG(scope))) { zend_class_entry *ce = object->ce; - zend_error(EG(current_execute_data) ? E_EXCEPTION | E_ERROR : E_WARNING, + zend_throw_error(zend_ce_error, EG(current_execute_data) ? E_EXCEPTION : E_WARNING, "Call to protected %s::__destruct() from context '%s'%s", ZSTR_VAL(ce->name), EG(scope) ? ZSTR_VAL(EG(scope)->name) : "", -- cgit v1.2.1