diff options
Diffstat (limited to 'Zend/zend_objects.c')
-rw-r--r-- | Zend/zend_objects.c | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c index cc26aa98d9..93b21e00d9 100644 --- a/Zend/zend_objects.c +++ b/Zend/zend_objects.c @@ -93,11 +93,17 @@ ZEND_API void zend_objects_destroy_object(zend_object *object) if (object->ce != EG(scope)) { zend_class_entry *ce = object->ce; - 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) : "", - EG(current_execute_data) ? "" : " during shutdown ignored"); + if (EG(current_execute_data)) { + zend_throw_error(zend_ce_error, + "Call to private %s::__destruct() from context '%s'", + ZSTR_VAL(ce->name), + EG(scope) ? ZSTR_VAL(EG(scope)->name) : ""); + } else { + zend_error(E_WARNING, + "Call to private %s::__destruct() from context '%s' during shutdown ignored", + ZSTR_VAL(ce->name), + EG(scope) ? ZSTR_VAL(EG(scope)->name) : ""); + } return; } } else { @@ -106,11 +112,17 @@ 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_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) : "", - EG(current_execute_data) ? "" : " during shutdown ignored"); + if (EG(current_execute_data)) { + zend_throw_error(zend_ce_error, + "Call to protected %s::__destruct() from context '%s'", + ZSTR_VAL(ce->name), + EG(scope) ? ZSTR_VAL(EG(scope)->name) : ""); + } else { + zend_error(E_WARNING, + "Call to protected %s::__destruct() from context '%s' during shutdown ignored", + ZSTR_VAL(ce->name), + EG(scope) ? ZSTR_VAL(EG(scope)->name) : ""); + } return; } } |