Skip to content

Commit 4288b90

Browse files
committed
Add AST export support
1 parent 4015618 commit 4288b90

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Zend/tests/assert/expect_015.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ assert(0 && ($a = function &(array &$a, ?X $b = null) use ($c,&$d) : ?X {
6060
$x = C::${$z . "_1"};
6161
$x?->y;
6262
$x?->y();
63+
foo(bar: $x);
6364
}
6465
}
6566
}));
@@ -202,6 +203,7 @@ Warning: assert(): assert(0 && ($a = function &(array &$a, ?X $b = null) use($c,
202203
$x = C::${$z . '_1'};
203204
$x?->y;
204205
$x?->y();
206+
foo(bar: $x);
205207
}
206208

207209
}

Zend/zend_ast.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2064,6 +2064,11 @@ static ZEND_COLD void zend_ast_export_ex(smart_str *str, zend_ast *ast, int prio
20642064
zend_ast_export_name(str, ast->child[1], 0, indent);
20652065
}
20662066
break;
2067+
case ZEND_AST_NAMED_ARG:
2068+
smart_str_append(str, zend_ast_get_str(ast->child[0]));
2069+
smart_str_appends(str, ": ");
2070+
ast = ast->child[1];
2071+
goto tail_call;
20672072

20682073
/* 3 child nodes */
20692074
case ZEND_AST_METHOD_CALL:

0 commit comments

Comments
 (0)