cvs: ZendEngine2 / zend_execute.c zend_reflection_api.c /tests bug33996.phpt
| From: | Dmitry Stogov | Date: | Mon, 19 Sep 2005 07:23:48 +0000 |
| Subject: | cvs: ZendEngine2 / zend_execute.c zend_reflection_api.c /tests bug33996.phpt | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-4141@lists.php.net to get a copy of this message | ||
dmitry Mon Sep 19 03:23:48 2005 EDT
Modified files:
/ZendEngine2 zend_execute.c zend_reflection_api.c
/ZendEngine2/tests bug33996.phpt
Log:
Unicode support
http://cvs.php.net/diff.php/ZendEngine2/zend_execute.c?r1=1.722&r2=1.723&ty=u Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.722 ZendEngine2/zend_execute.c:1.723 --- ZendEngine2/zend_execute.c:1.722 Thu Sep 15 12:19:41 2005 +++ ZendEngine2/zend_execute.c Mon Sep 19 03:23:44 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.c,v 1.722 2005/09/15 16:19:41 derick Exp $ */ +/* $Id: zend_execute.c,v 1.723 2005/09/19 07:23:44 dmitry Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -481,24 +481,24 @@ 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 @@ 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 @@ 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; } http://cvs.php.net/diff.php/ZendEngine2/zend_reflection_api.c?r1=1.179&r2=1.180&ty=u Index: ZendEngine2/zend_reflection_api.c diff -u ZendEngine2/zend_reflection_api.c:1.179 ZendEngine2/zend_reflection_api.c:1.180 --- ZendEngine2/zend_reflection_api.c:1.179 Fri Sep 16 16:20:46 2005 +++ ZendEngine2/zend_reflection_api.c Mon Sep 19 03:23:45 2005 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_reflection_api.c,v 1.179 2005/09/16 20:20:46 tony2001 Exp $ */ +/* $Id: zend_reflection_api.c,v 1.180 2005/09/19 07:23:45 dmitry Exp $ */ #include "zend.h" #include "zend_API.h" #include "zend_exceptions.h" @@ -43,8 +43,8 @@ /* 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; \ } \ http://cvs.php.net/diff.php/ZendEngine2/tests/bug33996.phpt?r1=1.2&r2=1.3&ty=u Index: ZendEngine2/tests/bug33996.phpt diff -u ZendEngine2/tests/bug33996.phpt:1.2 ZendEngine2/tests/bug33996.phpt:1.3 --- ZendEngine2/tests/bug33996.phpt:1.2 Thu Sep 15 12:19:43 2005 +++ ZendEngine2/tests/bug33996.phpt Mon Sep 19 03:23:47 2005 @@ -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 @@ --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 +
http://cvs.php.net/diff.php/ZendEngine2/zend_execute.c?r1=1.722&r2=1.723&ty=u Index: ZendEngine2/zend_execute.c diff -u ZendEngine2/zend_execute.c:1.722 ZendEngine2/zend_execute.c:1.723 --- ZendEngine2/zend_execute.c:1.722 Thu Sep 15 12:19:41 2005 +++ ZendEngine2/zend_execute.c Mon Sep 19 03:23:44 2005 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_execute.c,v 1.722 2005/09/15 16:19:41 derick Exp $ */ +/* $Id: zend_execute.c,v 1.723 2005/09/19 07:23:44 dmitry Exp $ */ #define ZEND_INTENSIVE_DEBUGGING 0 @@ -481,24 +481,24 @@ 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 @@ 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 @@ 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; } http://cvs.php.net/diff.php/ZendEngine2/zend_reflection_api.c?r1=1.179&r2=1.180&ty=u Index: ZendEngine2/zend_reflection_api.c diff -u ZendEngine2/zend_reflection_api.c:1.179 ZendEngine2/zend_reflection_api.c:1.180 --- ZendEngine2/zend_reflection_api.c:1.179 Fri Sep 16 16:20:46 2005 +++ ZendEngine2/zend_reflection_api.c Mon Sep 19 03:23:45 2005 @@ -19,7 +19,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_reflection_api.c,v 1.179 2005/09/16 20:20:46 tony2001 Exp $ */ +/* $Id: zend_reflection_api.c,v 1.180 2005/09/19 07:23:45 dmitry Exp $ */ #include "zend.h" #include "zend_API.h" #include "zend_exceptions.h" @@ -43,8 +43,8 @@ /* 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; \ } \ http://cvs.php.net/diff.php/ZendEngine2/tests/bug33996.phpt?r1=1.2&r2=1.3&ty=u Index: ZendEngine2/tests/bug33996.phpt diff -u ZendEngine2/tests/bug33996.phpt:1.2 ZendEngine2/tests/bug33996.phpt:1.3 --- ZendEngine2/tests/bug33996.phpt:1.2 Thu Sep 15 12:19:43 2005 +++ ZendEngine2/tests/bug33996.phpt Mon Sep 19 03:23:47 2005 @@ -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 @@ --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 +