summaryrefslogtreecommitdiff
path: root/Zend/zend_objects.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-08-09 14:32:33 +0000
committerMarcus Boerger <helly@php.net>2003-08-09 14:32:33 +0000
commitd4aa155d257b5b7e64b7be07e790cee1037a8935 (patch)
tree152eb520e11acdb235aad34c157ad2e0009ab83d /Zend/zend_objects.c
parent3c1cb7431eab779b4b00cabab8d073c9a6d6f2fe (diff)
downloadphp-git-d4aa155d257b5b7e64b7be07e790cee1037a8935.tar.gz
Precise destructor errors
Diffstat (limited to 'Zend/zend_objects.c')
-rw-r--r--Zend/zend_objects.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c
index 7749baf7db..114d069dd0 100644
--- a/Zend/zend_objects.c
+++ b/Zend/zend_objects.c
@@ -46,17 +46,28 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
/* Ensure that if we're calling a private function, we're allowed to do so.
*/
if (object->ce != EG(scope)) {
+ zend_class_entry *ce = object->ce;
+
zend_nuke_object(object TSRMLS_CC); /* unfortunately we *must* destroy it now anyway */
- /* this is a E_ERROR in real but we can't do that right now because of problems in shutdown */
- zend_error(E_WARNING, "Call to private destructor from context '%s'", EG(scope) ? EG(scope)->name : "");
+ zend_error(EG(in_execution) ? E_ERROR : E_WARNING,
+ "Call to private %s::__destruct from context '%s'%s",
+ ce->name,
+ EG(scope) ? EG(scope)->name : "",
+ EG(in_execution) ? "" : " during shutdown ignored");
return;
}
} else {
/* Ensure that if we're calling a protected function, we're allowed to do so.
*/
if (!zend_check_protected(destructor->common.scope, EG(scope))) {
+ zend_class_entry *ce = object->ce;
+
zend_nuke_object(object TSRMLS_CC); /* unfortunately we *must* destroy it now anyway */
- zend_error(E_WARNING, "Call to protected destructor from context '%s'", EG(scope) ? EG(scope)->name : "");
+ zend_error(EG(in_execution) ? E_ERROR : E_WARNING,
+ "Call to protected %s::__destruct from context '%s'%s",
+ ce->name,
+ EG(scope) ? EG(scope)->name : "",
+ EG(in_execution) ? "" : " during shutdown ignored");
return;
}
}