Skip to content

Commit fac43d6

Browse files
committed
Fix AST printing of nullable builtin types
Fixes oss-fuzz #19109.
1 parent c8e9aa8 commit fac43d6

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
@@ -1463,7 +1463,7 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio
14631463
}
14641464
break;
14651465
case ZEND_AST_TYPE:
1466-
switch (ast->attr) {
1466+
switch (ast->attr & ~ZEND_TYPE_NULLABLE) {
14671467
case IS_ARRAY: APPEND_STR("array");
14681468
case IS_CALLABLE: APPEND_STR("callable");
14691469
EMPTY_SWITCH_DEFAULT_CASE();

0 commit comments

Comments
 (0)