Skip to content

Commit 7577e79

Browse files
committed
Merge branch 'PHP-7.4'
* PHP-7.4: Fix AST printing of nullable builtin types
2 parents a6832ca + 3167e59 commit 7577e79

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Zend/tests/assert/expect_015.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ L0:
9494
}
9595
}));
9696

97-
assert(0 && ($a = function &(array &$a, X $b = null) use ($c,&$d) : X {
97+
assert(0 && ($a = function &(?array &$a, X $b = null) use ($c,&$d) : X {
9898
class A {
9999
use T1, T2 {
100100
T1::foo insteadof foo;
@@ -244,7 +244,7 @@ Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null, int|floa
244244

245245
})) failed in %sexpect_015.php on line %d
246246

247-
Warning: assert(): assert(0 && ($a = function &(array &$a, X $b = null) use($c, &$d): X {
247+
Warning: assert(): assert(0 && ($a = function &(?array &$a, X $b = null) use($c, &$d): X {
248248
class A {
249249
use T1, T2 {
250250
T1::foo insteadof foo;

Zend/zend_ast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1569,7 +1569,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio
15691569
}
15701570
break;
15711571
case ZEND_AST_TYPE:
1572-
switch (ast->attr) {
1572+
switch (ast->attr & ~ZEND_TYPE_NULLABLE) {
15731573
case IS_ARRAY: APPEND_STR("array");
15741574
case IS_CALLABLE: APPEND_STR("callable");
15751575
EMPTY_SWITCH_DEFAULT_CASE();

0 commit comments

Comments
 (0)