diff options
| author | Nikita Popov <nikita.ppv@gmail.com> | 2018-06-29 23:23:08 +0200 |
|---|---|---|
| committer | Nikita Popov <nikita.ppv@gmail.com> | 2018-06-29 23:23:08 +0200 |
| commit | 43c533d799e06d0ba94557cae3eee2619423fa7e (patch) | |
| tree | c7c79792f0b3ce61fedefbcf25743ae9d927b192 | |
| parent | 7ac06d66d4e19dc68b0440aff27f2a405354e5d6 (diff) | |
| parent | deb1bad80f7587856ecbb6e7f482205572588bef (diff) | |
| download | php-git-43c533d799e06d0ba94557cae3eee2619423fa7e.tar.gz | |
Merge branch 'PHP-7.2'
| -rw-r--r-- | Zend/tests/assert/expect_015.phpt | 4 | ||||
| -rw-r--r-- | Zend/zend_ast.c | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/Zend/tests/assert/expect_015.phpt b/Zend/tests/assert/expect_015.phpt index 0c53c75c4d..1679640851 100644 --- a/Zend/tests/assert/expect_015.phpt +++ b/Zend/tests/assert/expect_015.phpt @@ -20,7 +20,7 @@ assert(0 && ($a = function () { yield from $x; })); -assert(0 && ($a = function &(array &$a, X $b = null) use ($c,&$d) : X { +assert(0 && ($a = function &(array &$a, ?X $b = null) use ($c,&$d) : ?X { abstract class A extends B implements C, D { const X = 12; const Y = self::X, Z = "aaa"; @@ -161,7 +161,7 @@ Warning: assert(): assert(0 && ($a = function () { yield from $x; })) failed in %sexpect_015.php on line %d -Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c, &$d): X { +Warning: assert(): assert(0 && ($a = function &(array &$a, ?X $b = null) use($c, &$d): ?X { abstract class A extends B implements C, D { const X = 12; const Y = self::X, Z = 'aaa'; diff --git a/Zend/zend_ast.c b/Zend/zend_ast.c index 245a153308..838cc361ff 100644 --- a/Zend/zend_ast.c +++ b/Zend/zend_ast.c @@ -1347,6 +1347,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]) { @@ -1881,6 +1884,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, ' '); } |
