Skip to content

Commit 4e5e58b

Browse files
committed
zend_language_parser: Add support for passing a property list to clone
1 parent be165af commit 4e5e58b

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Zend/zend_ast.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,6 @@ enum _zend_ast_kind {
8989
ZEND_AST_ISSET,
9090
ZEND_AST_SILENCE,
9191
ZEND_AST_SHELL_EXEC,
92-
ZEND_AST_CLONE,
9392
ZEND_AST_PRINT,
9493
ZEND_AST_INCLUDE_OR_EVAL,
9594
ZEND_AST_UNARY_OP,
@@ -154,6 +153,7 @@ enum _zend_ast_kind {
154153
ZEND_AST_MATCH_ARM,
155154
ZEND_AST_NAMED_ARG,
156155
ZEND_AST_PARENT_PROPERTY_HOOK_CALL,
156+
ZEND_AST_CLONE,
157157

158158
/* 3 child nodes */
159159
ZEND_AST_METHOD_CALL = 3 << ZEND_AST_NUM_CHILDREN_SHIFT,

Zend/zend_language_parser.y

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1214,7 +1214,8 @@ expr:
12141214
{ $$ = zend_ast_create(ZEND_AST_ASSIGN, $1, $3); }
12151215
| variable '=' ampersand variable
12161216
{ $$ = zend_ast_create(ZEND_AST_ASSIGN_REF, $1, $4); }
1217-
| T_CLONE expr { $$ = zend_ast_create(ZEND_AST_CLONE, $2); }
1217+
| T_CLONE '(' expr ',' non_empty_argument_list ')' { $$ = zend_ast_create(ZEND_AST_CLONE, $3, $5); }
1218+
| T_CLONE expr { $$ = zend_ast_create(ZEND_AST_CLONE, $2, NULL); }
12181219
| variable T_PLUS_EQUAL expr
12191220
{ $$ = zend_ast_create_assign_op(ZEND_ADD, $1, $3); }
12201221
| variable T_MINUS_EQUAL expr

0 commit comments

Comments
 (0)