Skip to content

Commit 2d8fd58

Browse files
committed
Fix PHP 7.4 build
AST_ASSIGN_OP now directly stores the binary op, assign op opcodes no longer exist.
1 parent 113e782 commit 2d8fd58

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

ast.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,7 @@ static inline zend_uchar lookup_builtin_type(const zend_string *name) {
441441
return 0;
442442
}
443443

444+
#if PHP_VERSION_ID < 70400
444445
static inline zend_ast_attr ast_assign_op_to_binary_op(zend_ast_attr attr) {
445446
switch (attr) {
446447
case ZEND_ASSIGN_BW_OR: return ZEND_BW_OR;
@@ -458,6 +459,7 @@ static inline zend_ast_attr ast_assign_op_to_binary_op(zend_ast_attr attr) {
458459
EMPTY_SWITCH_DEFAULT_CASE()
459460
}
460461
}
462+
#endif
461463

462464
static inline zend_bool ast_array_is_list(zend_ast *ast) {
463465
zend_ast_list *list = zend_ast_get_list(ast);
@@ -687,9 +689,11 @@ static void ast_to_zval(zval *zv, zend_ast *ast, ast_state_info_t *state) {
687689
}
688690

689691
switch (ast->kind) {
692+
#if PHP_VERSION_ID < 70400
690693
case ZEND_AST_ASSIGN_OP:
691694
ast->attr = ast_assign_op_to_binary_op(ast->attr);
692695
break;
696+
#endif
693697
case ZEND_AST_GREATER:
694698
ast->kind = ZEND_AST_BINARY_OP;
695699
ast->attr = AST_BINARY_IS_GREATER;

tests/assign_ops.phpt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ AST_STMT_LIST
8181
expr: AST_VAR
8282
name: "b"
8383
9: AST_ASSIGN_OP
84-
flags: BINARY_POW (166)
84+
flags: BINARY_POW (%d)
8585
var: AST_VAR
8686
name: "a"
8787
expr: AST_VAR

0 commit comments

Comments
 (0)