cvs: ZendEngine2 / zend_API.c

From: Date: Sun, 21 May 2006 12:39:03 +0000
Subject: cvs: ZendEngine2 / zend_API.c
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-4915@lists.php.net to get a copy of this message
helly Sun May 21 12:39:03 2006 UTC Modified files: /ZendEngine2 zend_API.c Log: - Improve error messages (missing unicode todo) http://cvs.php.net/viewcvs.cgi/ZendEngine2/zend_API.c?r1=1.360&r2=1.361&diff_format=u Index: ZendEngine2/zend_API.c diff -u ZendEngine2/zend_API.c:1.360 ZendEngine2/zend_API.c:1.361 --- ZendEngine2/zend_API.c:1.360 Sat May 13 10:18:12 2006 +++ ZendEngine2/zend_API.c Sun May 21 12:39:03 2006 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_API.c,v 1.360 2006/05/13 10:18:12 helly Exp $ */ +/* $Id: zend_API.c,v 1.361 2006/05/21 12:39:03 helly Exp $ */ #include "zend.h" #include "zend_execute.h" @@ -314,7 +314,7 @@ return FAILURE; } -static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **spec, char T_arg_type TSRMLS_DC) +static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **spec, char T_arg_type, int* ret_type TSRMLS_DC) { char *spec_walk = *spec; char c = *spec_walk++; @@ -706,9 +706,11 @@ } else { if (Z_TYPE_PP(arg) == IS_NULL && return_null) { *p = NULL; + } else if (ce) { + *ret_type = UG(unicode)?IS_UNICODE:IS_STRING; + return ce->name.s; } else { - /* FIXME: Unicode support??? */ - return ce ? ce->name.s : "object"; + return "object"; } } } @@ -781,15 +783,16 @@ static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int quiet, char T_arg_type TSRMLS_DC) { char *expected_type = NULL; + int ret_type = IS_STRING; - expected_type = zend_parse_arg_impl(arg_num, arg, va, spec, T_arg_type TSRMLS_CC); + expected_type = zend_parse_arg_impl(arg_num, arg, va, spec, T_arg_type, &ret_type TSRMLS_CC); if (expected_type) { if (!quiet && *expected_type) { char *space; zstr class_name = get_active_class_name(&space TSRMLS_CC); - zend_error(E_WARNING, "%v%s%v() expects parameter %d to be %s, %s given", - class_name, space, get_active_function_name(TSRMLS_C), arg_num, expected_type, + zend_error(E_WARNING, "%v%s%v() expects parameter %d to be %R, %s given", + class_name, space, get_active_function_name(TSRMLS_C), arg_num, ret_type, expected_type, zend_zval_type_name(*arg)); } return FAILURE;

« previous php.zend-engine.cvs (#4915) next »