diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2018-06-29 23:22:41 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2018-06-29 23:22:41 +0200 |
commit | 962706d16c29ec6dd5ec3a78edae9e8907bca20a (patch) | |
tree | cf8d5797626d2677798e85ce048c83eac6853f09 /Zend/zend_ast.c | |
parent | fb09f1341f9924cb3d3a1c12caded82097378063 (diff) | |
download | php-git-962706d16c29ec6dd5ec3a78edae9e8907bca20a.tar.gz |
Fix nullable type pretty-printing
Diffstat (limited to 'Zend/zend_ast.c')
-rw-r--r-- | Zend/zend_ast.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index fd3cce8735..faa3b80d1e 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -1080,6 +1080,9 @@ tail_call: zend_ast_export_ex(str, decl->child[1], 0, indent); if (decl->child[3]) { smart_str_appends(str, ": "); + if (decl->child[3]->attr & ZEND_TYPE_NULLABLE) { + smart_str_appendc(str, '?'); + } zend_ast_export_ns_name(str, decl->child[3], 0, indent); } if (decl->child[2]) { @@ -1614,6 +1617,9 @@ simple_list: break; case ZEND_AST_PARAM: if (ast->child[0]) { + if (ast->child[0]->attr & ZEND_TYPE_NULLABLE) { + smart_str_appendc(str, '?'); + } zend_ast_export_ns_name(str, ast->child[0], 0, indent); smart_str_appendc(str, ' '); } |