]> granicus.if.org Git - php/commitdiff
Unicode support
authorDmitry Stogov <dmitry@php.net>
Mon, 19 Sep 2005 07:23:47 +0000 (07:23 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 19 Sep 2005 07:23:47 +0000 (07:23 +0000)
Zend/tests/bug33996.phpt
Zend/zend_execute.c
Zend/zend_reflection_api.c
ext/reflection/php_reflection.c

index a56bae1675c1e5cd2ce541729b88dfc3e6e00402..27fa60aaf9405a923bf6ef6ce20f2e95c7ebfd83 100755 (executable)
@@ -1,7 +1,7 @@
 --TEST--
 Bug #33996 (No information given for fatal error on passing invalid value to typed argument)
 --INI--
-error_reporting=4095
+error_reporting=8191
 --FILE--
 <?php
 class Foo
@@ -26,4 +26,5 @@ FooTest(new Foo());
 --EXPECTF--
 Warning: Missing argument 1 for NormalTest(), called in %sbug33996.php on line 17 and defined in %sbug33996.php on line 12
 Hi!
-Catchable fatal error: Argument 1 must be an object of class Foo, called in %sbug33996.php on line 18 and defined in %sbug33996.php on line 7
+Catchable fatal error: Argument 1 passed to FooTest() must be an object of class Foo, called in %sbug33996.php on line 18 and defined in %sbug33996.php on line 7
+
index 787f768a8242e6b07f4b06ae20826ad8e0cadd54..6ac9ccf28cbfdf1b2816665c382c63b7c81b606d 100644 (file)
@@ -481,24 +481,24 @@ static inline void zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zv
 
        cur_arg_info = &zf->common.arg_info[arg_num-1];
        fname = zf->common.function_name;
-       fsep = zf->common.scope ? "::" : "";
-       fclass = zf->common.scope ? zf->common.scope->name : "";
+       fsep = zf->common.scope ? "::" : EMPTY_STR;
+       fclass = zf->common.scope ? zf->common.scope->name : EMPTY_STR;
 
        if (cur_arg_info->class_name) {
                if (!arg) {
                        if (ptr && ptr->op_array) {
-                               zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an object of class %v, called in %s on line %d and defined", arg_num, fclass, fsep, fname, cur_arg_info->class_name, ptr->op_array->filename, ptr->opline->lineno);
+                               zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must be an object of class %v, called in %s on line %d and defined", arg_num, fclass, fsep, fname, cur_arg_info->class_name, ptr->op_array->filename, ptr->opline->lineno);
                        } else {
-                               zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an object of class %v", arg_num, fclass, fsep, fname, cur_arg_info->class_name);
+                               zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must be an object of class %v", arg_num, fclass, fsep, fname, cur_arg_info->class_name);
                        }
                }
                switch (Z_TYPE_P(arg)) {
                        case IS_NULL:
                                if (!cur_arg_info->allow_null) {
                                        if (ptr && ptr->op_array) {
-                                               zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must not be null, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
+                                               zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must not be null, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
                                        } else {
-                                               zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must not be null", arg_num, fclass, fsep, fname);
+                                               zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must not be null", arg_num, fclass, fsep, fname);
                                        }
                                }
                                break;
@@ -513,36 +513,36 @@ static inline void zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zv
                                                        error_msg = "be an instance of";
                                                }
                                                if (ptr && ptr->op_array) {
-                                                       zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must %s %v, called in %s on line %d and defined", arg_num, fclass, fsep, fname, error_msg, ce->name, ptr->op_array->filename, ptr->opline->lineno);
+                                                       zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must %s %v, called in %s on line %d and defined", arg_num, fclass, fsep, fname, error_msg, ce->name, ptr->op_array->filename, ptr->opline->lineno);
                                                } else {
-                                                       zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must %s %v", arg_num, fclass, fsep, fname, error_msg, ce->name);
+                                                       zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must %s %v", arg_num, fclass, fsep, fname, error_msg, ce->name);
                                                }
                                        }
                                }
                                break;
                        default:
                                if (ptr && ptr->op_array) {
-                                       zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an object of class %v, called in %s on line %d and defined", arg_num, fclass, fsep, fname, cur_arg_info->class_name, ptr->op_array->filename, ptr->opline->lineno);
+                                       zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must be an object of class %v, called in %s on line %d and defined", arg_num, fclass, fsep, fname, cur_arg_info->class_name, ptr->op_array->filename, ptr->opline->lineno);
                                } else {
-                                       zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an object of class %v", arg_num, fclass, fsep, fname, cur_arg_info->class_name);
+                                       zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must be an object of class %v", arg_num, fclass, fsep, fname, cur_arg_info->class_name);
                                }
                                break;
                }
        }       else if (cur_arg_info->array_type_hint) {
                if (!arg) {
                        if (ptr && ptr->op_array) {
-                               zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an array, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
+                               zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must be an array, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
                        } else { 
-                               zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an array", arg_num, fclass, fsep, fname);
+                               zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must be an array", arg_num, fclass, fsep, fname);
                        }
                }
                switch (Z_TYPE_P(arg)) {
                        case IS_NULL:
                                if (!cur_arg_info->allow_null) {
                                        if (ptr && ptr->op_array) {
-                                               zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must not be null, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
+                                               zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must not be null, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
                                        } else {
-                                               zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must not be null", arg_num, fclass, fsep, fname);
+                                               zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must not be null", arg_num, fclass, fsep, fname);
                                        }
                                }
                                break;
@@ -550,9 +550,9 @@ static inline void zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zv
                                break;
                        default:        
                                if (ptr && ptr->op_array) {
-                                       zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an array, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
+                                       zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must be an array, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
                                } else {
-                                       zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %s%s%s() must be an array", arg_num, fclass, fsep, fname);
+                                       zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must be an array", arg_num, fclass, fsep, fname);
                                }
                                break;
                }
index dec1f9d7d64b5173370954e68d7ed68600bb25b6..2bc0341b350b8bbdac048873bc5d76e18ef7fb67 100644 (file)
@@ -43,8 +43,8 @@ zend_class_entry *reflection_extension_ptr;
 /* Method macros */
 
 #define METHOD_NOTSTATIC(ce)                                                                                \
-       if (!this_ptr || !instanceof_function(Z_OBJCE_P(this_ptr), ce TSRMLS_CC)) {                             \
-               zend_error(E_ERROR, "%s() cannot be called statically", get_active_function_name(TSRMLS_C));        \
+       if (!this_ptr || !instanceof_function(Z_OBJCE_P(this_ptr), U_CLASS_ENTRY(ce) TSRMLS_CC)) {                             \
+               zend_error(E_ERROR, "%v() cannot be called statically", get_active_function_name(TSRMLS_C));        \
                return;                                                                                             \
        }                                                                                                       \
 
index dec1f9d7d64b5173370954e68d7ed68600bb25b6..2bc0341b350b8bbdac048873bc5d76e18ef7fb67 100644 (file)
@@ -43,8 +43,8 @@ zend_class_entry *reflection_extension_ptr;
 /* Method macros */
 
 #define METHOD_NOTSTATIC(ce)                                                                                \
-       if (!this_ptr || !instanceof_function(Z_OBJCE_P(this_ptr), ce TSRMLS_CC)) {                             \
-               zend_error(E_ERROR, "%s() cannot be called statically", get_active_function_name(TSRMLS_C));        \
+       if (!this_ptr || !instanceof_function(Z_OBJCE_P(this_ptr), U_CLASS_ENTRY(ce) TSRMLS_CC)) {                             \
+               zend_error(E_ERROR, "%v() cannot be called statically", get_active_function_name(TSRMLS_C));        \
                return;                                                                                             \
        }                                                                                                       \