diff options
| author | Felipe Pena <felipe@php.net> | 2010-05-14 23:48:03 +0000 |
|---|---|---|
| committer | Felipe Pena <felipe@php.net> | 2010-05-14 23:48:03 +0000 |
| commit | f5f4a359271a24588828840532af12f5082965ab (patch) | |
| tree | 62924fa7e592dcc41b4c2bc6b81e26fe2241df16 | |
| parent | 3ea05600e92d465262c4388d7570cb92b2979a3a (diff) | |
| download | php-git-f5f4a359271a24588828840532af12f5082965ab.tar.gz | |
- Fixed bug #51827 (Bad warning when register_shutdown_function called with wrong num of parameters)
| -rw-r--r-- | Zend/tests/bug51827.phpt | 19 | ||||
| -rw-r--r-- | Zend/zend_API.c | 6 |
2 files changed, 22 insertions, 3 deletions
diff --git a/Zend/tests/bug51827.phpt b/Zend/tests/bug51827.phpt new file mode 100644 index 0000000000..0834749454 --- /dev/null +++ b/Zend/tests/bug51827.phpt @@ -0,0 +1,19 @@ +--TEST-- +Bug #51827 (Bad warning when register_shutdown_function called with wrong num of parameters) +--FILE-- +<?php + + +function abc() { + var_dump(1); +} + +register_shutdown_function('timE'); +register_shutdown_function('ABC'); +register_shutdown_function('exploDe'); + +?> +--EXPECTF-- +int(1) + +Warning: explode() expects at least 2 parameters, 0 given in Unknown on line %d diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 31f24f8513..db9c97df30 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -724,7 +724,7 @@ static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int fl zend_error(E_WARNING, "%s%s%s(): only one varargs specifier (* or +) is permitted", class_name, class_name[0] ? "::" : "", - get_active_function_name(TSRMLS_C)); + active_function->common.function_name); } return FAILURE; } @@ -744,7 +744,7 @@ static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int fl zend_error(E_WARNING, "%s%s%s(): bad type specifier while parsing parameters", class_name, class_name[0] ? "::" : "", - get_active_function_name(TSRMLS_C)); + active_function->common.function_name); } return FAILURE; } @@ -767,7 +767,7 @@ static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int fl 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), + active_function->common.function_name, 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", |
