Skip to content

Commit 261eb5c

Browse files
committed
Merge branch 'PHP-7.0'
2 parents 55f0186 + 69efeb1 commit 261eb5c

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

Zend/zend_ast.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -338,21 +338,13 @@ ZEND_API int zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *sc
338338
}
339339
break;
340340
case ZEND_AST_COALESCE:
341-
if (ast->child[0]->kind == ZEND_AST_DIM) {
342-
ast->child[0]->attr = ZEND_DIM_IS;
343-
}
344-
345341
if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
346342
ret = FAILURE;
347343
break;
348344
}
349345
if (Z_TYPE(op1) > IS_NULL) {
350346
*result = op1;
351347
} else {
352-
if (ast->child[1]->kind == ZEND_AST_DIM) {
353-
ast->child[1]->attr = ZEND_DIM_IS;
354-
}
355-
356348
if (UNEXPECTED(zend_ast_evaluate(result, ast->child[1], scope) != SUCCESS)) {
357349
zval_dtor(&op1);
358350
ret = FAILURE;
@@ -413,10 +405,6 @@ ZEND_API int zend_ast_evaluate(zval *result, zend_ast *ast, zend_class_entry *sc
413405
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading");
414406
}
415407

416-
if (ast->attr == ZEND_DIM_IS && ast->child[0]->kind == ZEND_AST_DIM) {
417-
ast->child[0]->attr = ZEND_DIM_IS;
418-
}
419-
420408
if (UNEXPECTED(zend_ast_evaluate(&op1, ast->child[0], scope) != SUCCESS)) {
421409
ret = FAILURE;
422410
} else if (UNEXPECTED(zend_ast_evaluate(&op2, ast->child[1], scope) != SUCCESS)) {

Zend/zend_compile.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7869,6 +7869,10 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
78697869
}
78707870
break;
78717871
case ZEND_AST_COALESCE:
7872+
/* Set isset fetch indicator here, opcache disallows runtime altering of the AST */
7873+
if (ast->child[0]->kind == ZEND_AST_DIM) {
7874+
ast->child[0]->attr = ZEND_DIM_IS;
7875+
}
78727876
zend_eval_const_expr(&ast->child[0]);
78737877

78747878
if (ast->child[0]->kind != ZEND_AST_ZVAL) {
@@ -7921,6 +7925,11 @@ void zend_eval_const_expr(zend_ast **ast_ptr) /* {{{ */
79217925
zend_error_noreturn(E_COMPILE_ERROR, "Cannot use [] for reading");
79227926
}
79237927

7928+
/* Set isset fetch indicator here, opcache disallows runtime altering of the AST */
7929+
if (ast->attr == ZEND_DIM_IS && ast->child[0]->kind == ZEND_AST_DIM) {
7930+
ast->child[0]->attr = ZEND_DIM_IS;
7931+
}
7932+
79247933
zend_eval_const_expr(&ast->child[0]);
79257934
zend_eval_const_expr(&ast->child[1]);
79267935
if (ast->child[0]->kind != ZEND_AST_ZVAL || ast->child[1]->kind != ZEND_AST_ZVAL) {

0 commit comments

Comments
 (0)