Skip to content

Commit 1b65374

Browse files
committed
fixup! Support first-class callables in const-expressions
1 parent 2b5f8b1 commit 1b65374

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

ext/opcache/zend_persist.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ static zend_ast *zend_persist_ast(zend_ast *ast)
195195
zend_persist_op_array(&z);
196196
copy->op_array = Z_PTR(z);
197197
node = (zend_ast *) copy;
198+
} else if (ast->kind == ZEND_AST_CALLABLE_CONVERT) {
199+
zend_ast_fcc *copy = zend_shared_memdup(ast, sizeof(zend_ast_fcc));
200+
node = (zend_ast *) copy;
198201
} else if (zend_ast_is_decl(ast)) {
199202
/* Not implemented. */
200203
ZEND_UNREACHABLE();

ext/opcache/zend_persist_calc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ static void zend_persist_ast_calc(zend_ast *ast)
9191
zval z;
9292
ZVAL_PTR(&z, zend_ast_get_op_array(ast)->op_array);
9393
zend_persist_op_array_calc(&z);
94+
} else if (ast->kind == ZEND_AST_CALLABLE_CONVERT) {
95+
ADD_SIZE(sizeof(zend_ast_fcc));
9496
} else if (zend_ast_is_decl(ast)) {
9597
/* Not implemented. */
9698
ZEND_UNREACHABLE();

0 commit comments

Comments
 (0)