helly           Sat Aug  9 10:32:33 2003 EDT

  Modified files:              
    /ZendEngine2        zend_objects.c 
    /php-src/tests/classes      factory_and_singleton_005.phpt 
                                factory_and_singleton_006.phpt 
  Log:
  Precise destructor errors
  
Index: ZendEngine2/zend_objects.c
diff -u ZendEngine2/zend_objects.c:1.36 ZendEngine2/zend_objects.c:1.37
--- ZendEngine2/zend_objects.c:1.36     Sun Jul 27 09:20:31 2003
+++ ZendEngine2/zend_objects.c  Sat Aug  9 10:32:33 2003
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_objects.c,v 1.36 2003/07/27 13:20:31 stas Exp $ */
+/* $Id: zend_objects.c,v 1.37 2003/08/09 14:32:33 helly Exp $ */
 
 #include "zend.h"
 #include "zend_globals.h"
@@ -46,17 +46,28 @@
                                /* 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;
                                }
                        }
Index: php-src/tests/classes/factory_and_singleton_005.phpt
diff -u php-src/tests/classes/factory_and_singleton_005.phpt:1.2 
php-src/tests/classes/factory_and_singleton_005.phpt:1.3
--- php-src/tests/classes/factory_and_singleton_005.phpt:1.2    Thu Jul  3 03:18:41 
2003
+++ php-src/tests/classes/factory_and_singleton_005.phpt        Sat Aug  9 10:32:33 
2003
@@ -16,5 +16,4 @@
 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
Index: php-src/tests/classes/factory_and_singleton_006.phpt
diff -u php-src/tests/classes/factory_and_singleton_006.phpt:1.2 
php-src/tests/classes/factory_and_singleton_006.phpt:1.3
--- php-src/tests/classes/factory_and_singleton_006.phpt:1.2    Thu Jul  3 03:18:41 
2003
+++ php-src/tests/classes/factory_and_singleton_006.phpt        Sat Aug  9 10:32:33 
2003
@@ -16,5 +16,5 @@
 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
+



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to