diff options
-rw-r--r-- | Zend/zend_objects.c | 17 | ||||
-rwxr-xr-x | tests/classes/factory_and_singleton_005.phpt | 3 | ||||
-rwxr-xr-x | tests/classes/factory_and_singleton_006.phpt | 4 |
3 files changed, 17 insertions, 7 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; } } diff --git a/tests/classes/factory_and_singleton_005.phpt b/tests/classes/factory_and_singleton_005.phpt index fc000b87e2..fab99e312d 100755 --- a/tests/classes/factory_and_singleton_005.phpt +++ b/tests/classes/factory_and_singleton_005.phpt @@ -16,5 +16,4 @@ $obj = NULL; echo "Done\n"; ?> --EXPECTF-- -Warning: Call to protected destructor from context '' in %sfactory_and_singleton_005.php on line %d -Done +Fatal error: Call to protected test::__destruct from context '' in %sfactory_and_singleton_005.php on line %d diff --git a/tests/classes/factory_and_singleton_006.phpt b/tests/classes/factory_and_singleton_006.phpt index 5b54b9f0fa..6381550711 100755 --- a/tests/classes/factory_and_singleton_006.phpt +++ b/tests/classes/factory_and_singleton_006.phpt @@ -16,5 +16,5 @@ $obj = NULL; echo "Done\n"; ?> --EXPECTF-- -Warning: Call to private destructor from context '' in %sfactory_and_singleton_006.php on line %d -Done +Fatal error: Call to private test::__destruct from context '' in %sfactory_and_singleton_006.php on line %d + |