]> granicus.if.org Git - php/commitdiff
Synch/Unify error messages related to function/method calls
authorMarcus Boerger <helly@php.net>
Tue, 2 Sep 2003 14:08:59 +0000 (14:08 +0000)
committerMarcus Boerger <helly@php.net>
Tue, 2 Sep 2003 14:08:59 +0000 (14:08 +0000)
Zend/zend_execute.c
Zend/zend_object_handlers.c
Zend/zend_objects.c
tests/classes/factory_and_singleton_002.phpt
tests/classes/factory_and_singleton_003.phpt
tests/classes/factory_and_singleton_004.phpt
tests/classes/factory_and_singleton_005.phpt
tests/classes/factory_and_singleton_006.phpt
tests/classes/factory_and_singleton_007.phpt
tests/classes/factory_and_singleton_008.phpt

index ae957a726a5c2e8b8af107a1e6a6143e479d42de..de31c1c89c4117bf4c25fe336e8de7372c9064a7 100644 (file)
@@ -2475,7 +2475,7 @@ int zend_init_fcall_by_name_handler(ZEND_OPCODE_HANDLER_ARGS)
        }
 
        if (zend_hash_find(EG(function_table), function_name_strval, function_name_strlen+1, (void **) &function)==FAILURE) {
-               zend_error(E_ERROR, "Call to undefined function %s()", function_name_strval);
+               zend_error(E_ERROR, "Call to undefined function %s()", function_name_strval);
        }
 
        if (!is_const) {
@@ -3122,13 +3122,13 @@ int zend_clone_handler(ZEND_OPCODE_HANDLER_ARGS)
                        /* Ensure that if we're calling a private function, we're allowed to do so.
                         */
                        if (ce != EG(scope)) {
-                               zend_error(E_ERROR, "Call to private __clone from context '%s'", EG(scope) ? EG(scope)->name : "");
+                               zend_error(E_ERROR, "Call to private %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
                        }
                } else if ((clone->common.fn_flags & ZEND_ACC_PROTECTED)) {
                        /* Ensure that if we're calling a protected function, we're allowed to do so.
                         */
                        if (!zend_check_protected(clone->common.scope, EG(scope))) {
-                               zend_error(E_ERROR, "Call to protected __clone from context '%s'", EG(scope) ? EG(scope)->name : "");
+                               zend_error(E_ERROR, "Call to protected %s::__clone() from context '%s'", ce->name, EG(scope) ? EG(scope)->name : "");
                        }
                }
        }
index 25d10aaf541c6bde9f7c66a3db46eb6df55f46a7..a5914cbad9d2b5282cea9ac65c3e81cb2476dd1f 100644 (file)
@@ -765,13 +765,13 @@ static union _zend_function *zend_std_get_constructor(zval *object TSRMLS_DC)
                        /* Ensure that if we're calling a private function, we're allowed to do so.
                         */
                        if (object->value.obj.handlers->get_class_entry(object TSRMLS_CC) != EG(scope)) {
-                               zend_error(E_ERROR, "Call to private constructor from context '%s'", EG(scope) ? EG(scope)->name : "");
+                               zend_error(E_ERROR, "Call to private %s::%s() from context '%s'", constructor->common.scope->name, constructor->common.function_name, EG(scope) ? EG(scope)->name : "");
                        }
                } else if ((constructor->common.fn_flags & ZEND_ACC_PROTECTED)) {
                        /* Ensure that if we're calling a protected function, we're allowed to do so.
                         */
                        if (!zend_check_protected(constructor->common.scope, EG(scope))) {
-                               zend_error(E_ERROR, "Call to protected constructor from context '%s'", EG(scope) ? EG(scope)->name : "");
+                               zend_error(E_ERROR, "Call to protected %s::%s() from context '%s'", constructor->common.scope->name, constructor->common.function_name, EG(scope) ? EG(scope)->name : "");
                        }
                }
        }
index 114d069dd04b564208ac87f454c36b13a8cf8b6c..67e943428acec1bdf2abb3e106426e3d87bf0626 100644 (file)
@@ -50,7 +50,7 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
 
                                        zend_nuke_object(object TSRMLS_CC); /* unfortunately we *must* destroy it now anyway */
                                        zend_error(EG(in_execution) ? E_ERROR : E_WARNING, 
-                                               "Call to private %s::__destruct from context '%s'%s", 
+                                               "Call to private %s::__destruct() from context '%s'%s", 
                                                ce->name, 
                                                EG(scope) ? EG(scope)->name : "", 
                                                EG(in_execution) ? "" : " during shutdown ignored");
@@ -64,7 +64,7 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
 
                                        zend_nuke_object(object TSRMLS_CC); /* unfortunately we *must* destroy it now anyway */
                                        zend_error(EG(in_execution) ? E_ERROR : E_WARNING, 
-                                               "Call to protected %s::__destruct from context '%s'%s", 
+                                               "Call to protected %s::__destruct() from context '%s'%s", 
                                                ce->name, 
                                                EG(scope) ? EG(scope)->name : "", 
                                                EG(in_execution) ? "" : " during shutdown ignored");
index 2cb9a892f046496b210224a9b2a3f75ab46d9760..3308a561a506e96b9f6d3959803fca44bad4518b 100755 (executable)
@@ -97,4 +97,4 @@ int(1)
 int(1)
 Done
 
-Warning: Call to protected test::__destruct from context '' during shutdown ignored in Unknown on line 0
+Warning: Call to protected test::__destruct() from context '' during shutdown ignored in Unknown on line 0
index d5fc00491bd6561a06832bf248bebb012778fd6d..d81cc4642c5f8310a3020dce0995c34a738b9e86 100755 (executable)
@@ -15,4 +15,4 @@ $obj = new test;
 echo "Done\n";
 ?>
 --EXPECTF--
-Fatal error: Call to protected constructor from context '' %sfactory_and_singleton_003.php on line %d
+Fatal error: Call to protected test::__construct() from context '' %sfactory_and_singleton_003.php on line %d
index 047762d62952f3368c2ef76dccc8966126a7035d..01c53d85a3ce4b5fa53dd253db53691233a2a1c8 100755 (executable)
@@ -15,4 +15,4 @@ $obj = new test;
 echo "Done\n";
 ?>
 --EXPECTF--
-Fatal error: Call to private constructor from context '' %sfactory_and_singleton_004.php on line %d
+Fatal error: Call to private test::__construct() from context '' %sfactory_and_singleton_004.php on line %d
index fab99e312d97b691243c2ba70e21c39d73c94d3d..2cd7e5cc997b7cd84503e3ff4d0e74755e8b10a3 100755 (executable)
@@ -16,4 +16,4 @@ $obj = NULL;
 echo "Done\n";
 ?>
 --EXPECTF--
-Fatal error: Call to protected test::__destruct from context '' in %sfactory_and_singleton_005.php on line %d
+Fatal error: Call to protected test::__destruct() from context '' in %sfactory_and_singleton_005.php on line %d
index 6381550711358817847e682880d2dfb3affcddeb..81cf714888b8739c885fec90027037214f998bda 100755 (executable)
@@ -16,5 +16,5 @@ $obj = NULL;
 echo "Done\n";
 ?>
 --EXPECTF--
-Fatal error: Call to private test::__destruct from context '' in %sfactory_and_singleton_006.php on line %d
+Fatal error: Call to private test::__destruct() from context '' in %sfactory_and_singleton_006.php on line %d
 
index 5352dedb00f349e942e0e8c194dc4cd96f422e64..8ca8982fa334e80ab9bb80c578d83685e04eafc6 100755 (executable)
@@ -17,4 +17,4 @@ $obj = NULL;
 echo "Done\n";
 ?>
 --EXPECTF--
-Fatal error: Call to protected __clone from context '' %sfactory_and_singleton_007.php on line %d
+Fatal error: Call to protected test::__clone() from context '' %sfactory_and_singleton_007.php on line %d
index 77e3d78dfa0a62946d786f479f05a5f9d97c9417..b3fbf29f2eb247fbbef218a4c11d0f3cec6a8da0 100755 (executable)
@@ -17,4 +17,4 @@ $obj = NULL;
 echo "Done\n";
 ?>
 --EXPECTF--
-Fatal error: Call to private __clone from context '' %sfactory_and_singleton_008.php on line %d
+Fatal error: Call to private test::__clone() from context '' %sfactory_and_singleton_008.php on line %d