Skip to content

Commit 3167e59

Browse files
committed
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3: Fix AST printing of nullable builtin types
2 parents 7cbf31a + fac43d6 commit 3167e59

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) use($c,
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
@@ -1557,7 +1557,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio
15571557
}
15581558
break;
15591559
case ZEND_AST_TYPE:
1560-
switch (ast->attr) {
1560+
switch (ast->attr & ~ZEND_TYPE_NULLABLE) {
15611561
case IS_ARRAY: APPEND_STR("array");
15621562
case IS_CALLABLE: APPEND_STR("callable");
15631563
EMPTY_SWITCH_DEFAULT_CASE();

0 commit comments

Comments
 (0)