diff options
author | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-04-09 09:46:44 +0200 |
---|---|---|
committer | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-04-10 22:50:33 +0200 |
commit | fe9860c2b00668b1afd2205b49d9636aba3da21b (patch) | |
tree | 18a04455e5a4630e8cbe55a72e0e8cf3034e9f0d /Zend/zend_inheritance.c | |
parent | 4aa137c6a624f4f03b04bea60d61872ec490e4f8 (diff) | |
download | php-git-fe9860c2b00668b1afd2205b49d9636aba3da21b.tar.gz |
Improve the default value format in incompatible signature error messages
Closes GH-5361
Diffstat (limited to 'Zend/zend_inheritance.c')
-rw-r--r-- | Zend/zend_inheritance.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 5f7f115af4..1c10da5616 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -710,7 +710,7 @@ static ZEND_COLD zend_string *zend_get_function_declaration(const zend_function } else if (Z_TYPE_P(zv) == IS_TRUE) { smart_str_appends(&str, "true"); } else if (Z_TYPE_P(zv) == IS_NULL) { - smart_str_appends(&str, "NULL"); + smart_str_appends(&str, "null"); } else if (Z_TYPE_P(zv) == IS_STRING) { smart_str_appendc(&str, '\''); smart_str_appendl(&str, Z_STRVAL_P(zv), MIN(Z_STRLEN_P(zv), 10)); @@ -719,7 +719,11 @@ static ZEND_COLD zend_string *zend_get_function_declaration(const zend_function } smart_str_appendc(&str, '\''); } else if (Z_TYPE_P(zv) == IS_ARRAY) { - smart_str_appends(&str, "Array"); + if (zend_hash_num_elements(Z_ARRVAL_P(zv)) == 0) { + smart_str_appends(&str, "[]"); + } else { + smart_str_appends(&str, "[...]"); + } } else if (Z_TYPE_P(zv) == IS_CONSTANT_AST) { zend_ast *ast = Z_ASTVAL_P(zv); if (ast->kind == ZEND_AST_CONSTANT) { |