summaryrefslogtreecommitdiff
path: root/sapi/phpdbg/phpdbg_info.c
diff options
context:
space:
mode:
authorMáté Kocsis <kocsismate@woohoolabs.com>2020-05-25 19:28:15 +0200
committerMáté Kocsis <kocsismate@woohoolabs.com>2020-05-26 19:06:19 +0200
commitfbe30592d6bec94463c68b27eabffca3a50c474e (patch)
tree5f7e2ca5bb754504eb0e4f7a49609088832172aa /sapi/phpdbg/phpdbg_info.c
parent38c85efe83004d98b7cce89689b40de32f8b8add (diff)
downloadphp-git-fbe30592d6bec94463c68b27eabffca3a50c474e.tar.gz
Improve type error messages when an object is given
From now on, we always display the given object's type instead of just reporting "object". Additionally, make the format of return type errors match the format of argument errors. Closes GH-5625
Diffstat (limited to 'sapi/phpdbg/phpdbg_info.c')
-rw-r--r--sapi/phpdbg/phpdbg_info.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sapi/phpdbg/phpdbg_info.c b/sapi/phpdbg/phpdbg_info.c
index b576187c7a..783681009e 100644
--- a/sapi/phpdbg/phpdbg_info.c
+++ b/sapi/phpdbg/phpdbg_info.c
@@ -123,7 +123,7 @@ PHPDBG_INFO(constants) /* {{{ */
"address=\"%p\" refcount=\"%d\" type=\"%s\" name=\"%.*s\" " attrs, \
"%-18p %-7d %-9s %.*s" msg, &data->value, \
Z_REFCOUNTED(data->value) ? Z_REFCOUNT(data->value) : 1, \
- zend_zval_type_name(&data->value), \
+ zend_get_type_by_const(Z_TYPE(data->value)), \
(int) ZSTR_LEN(data->name), ZSTR_VAL(data->name), ##__VA_ARGS__)
switch (Z_TYPE(data->value)) {
@@ -231,7 +231,7 @@ static int phpdbg_print_symbols(zend_bool show_globals) {
#define VARIABLEINFO(attrs, msg, ...) \
phpdbg_writeln("variable", \
"address=\"%p\" refcount=\"%d\" type=\"%s\" refstatus=\"%s\" name=\"%.*s\" " attrs, \
- "%-18p %-7d %-9s %s$%.*s" msg, data, Z_REFCOUNTED_P(data) ? Z_REFCOUNT_P(data) : 1, zend_zval_type_name(data), isref, (int) ZSTR_LEN(var), ZSTR_VAL(var), ##__VA_ARGS__)
+ "%-18p %-7d %-9s %s$%.*s" msg, data, Z_REFCOUNTED_P(data) ? Z_REFCOUNT_P(data) : 1, zend_get_type_by_const(Z_TYPE_P(data)), isref, (int) ZSTR_LEN(var), ZSTR_VAL(var), ##__VA_ARGS__)
retry_switch:
switch (Z_TYPE_P(data)) {
case IS_RESOURCE: