summaryrefslogtreecommitdiff
path: root/Zend/zend_objects.c
diff options
context:
space:
mode:
authorAaron Piotrowski <aaron@trowski.com>2015-07-03 16:04:33 -0500
committerAaron Piotrowski <aaron@trowski.com>2015-07-03 17:53:41 -0500
commit22c38b2ef58fc97ca8cd82ae456d0082d2a8cd22 (patch)
tree43c93840eeb0bdbbe32af87291f9ff4216c264aa /Zend/zend_objects.c
parent5a99c07eccb09c3c8b9f6fe4b83020163aad6498 (diff)
downloadphp-git-22c38b2ef58fc97ca8cd82ae456d0082d2a8cd22.tar.gz
Remove need to pass error level
Diffstat (limited to 'Zend/zend_objects.c')
-rw-r--r--Zend/zend_objects.c32
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;
}
}