summaryrefslogtreecommitdiff
path: root/Zend/zend_API.c
diff options
context:
space:
mode:
authorMarcus Boerger <helly@php.net>2003-08-13 07:02:44 +0000
committerMarcus Boerger <helly@php.net>2003-08-13 07:02:44 +0000
commite08aedf5ff38553a73909c478b1dfba5dd58c4e6 (patch)
tree53a00bc356711d6312aceb68f7b24edc613b8252 /Zend/zend_API.c
parent05db087834175cb33711713293514b5671bc223e (diff)
downloadphp-git-e08aedf5ff38553a73909c478b1dfba5dd58c4e6.tar.gz
- Show classes in case of methods
- Using sprintf here was a bad idea
Diffstat (limited to 'Zend/zend_API.c')
-rw-r--r--Zend/zend_API.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index 6ceb971ba0..fc35227541 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -456,7 +456,6 @@ static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int
static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int flags TSRMLS_DC)
{
char *spec_walk;
- char buf[1024];
int c, i;
int min_num_args = -1;
int max_num_args = 0;
@@ -487,7 +486,12 @@ static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int fl
default:
if (!quiet) {
- zend_error(E_WARNING, "%s(): bad type specifier while parsing parameters", get_active_function_name(TSRMLS_C));
+ zend_function *active_function = EG(function_state_ptr)->function;
+ char *class_name = active_function->common.scope ? active_function->common.scope->name : "";
+ zend_error(E_WARNING, "%s%s%s(): bad type specifier while parsing parameters",
+ class_name,
+ class_name[0] ? "::" : "",
+ get_active_function_name(TSRMLS_C));
}
return FAILURE;
}
@@ -499,13 +503,16 @@ static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int fl
if (num_args < min_num_args || num_args > max_num_args) {
if (!quiet) {
- sprintf(buf, "%s() expects %s %d parameter%s, %d given",
+ zend_function *active_function = EG(function_state_ptr)->function;
+ char *class_name = active_function->common.scope ? active_function->common.scope->name : "";
+ zend_error(E_WARNING, "%s%s%s() expects %s %d parameter%s, %d given",
+ class_name,
+ class_name[0] ? "::" : "",
get_active_function_name(TSRMLS_C),
min_num_args == max_num_args ? "exactly" : num_args < min_num_args ? "at least" : "at most",
num_args < min_num_args ? min_num_args : max_num_args,
(num_args < min_num_args ? min_num_args : max_num_args) == 1 ? "" : "s",
num_args);
- zend_error(E_WARNING, buf);
}
return FAILURE;
}