Skip to content

Commit e6831db

Browse files
committed
Merge branch 'PHP-8.2'
* PHP-8.2: Fixed type inference
2 parents baef47e + 94b8c2d commit e6831db

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

Zend/Optimizer/zend_inference.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2322,9 +2322,9 @@ static zend_always_inline zend_result _zend_update_type_info(
23222322
if (ssa_op->op2_def >= 0 && !(ssa_var_info[ssa_op->op2_def].type & MAY_BE_REF)) {
23232323
UPDATE_SSA_TYPE(tmp, ssa_op->op2_def);
23242324
}
2325-
if (opline->opcode == ZEND_ASSIGN_OP
2326-
|| opline->opcode == ZEND_ASSIGN_DIM_OP
2325+
if (opline->opcode == ZEND_ASSIGN_DIM_OP
23272326
|| opline->opcode == ZEND_ASSIGN_OBJ_OP
2327+
|| opline->opcode == ZEND_ASSIGN_STATIC_PROP_OP
23282328
|| opline->opcode == ZEND_ASSIGN_DIM
23292329
|| opline->opcode == ZEND_ASSIGN_OBJ) {
23302330
if ((ssa_op+1)->op1_def >= 0 && !(ssa_var_info[(ssa_op+1)->op1_def].type & MAY_BE_REF)) {
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
Type inference 021;
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.optimization_level=-1
7+
--FILE--
8+
<?php
9+
function foo() {
10+
for(;;){
11+
$b->y++;
12+
$b *= $a;
13+
$a++;
14+
}
15+
}
16+
?>
17+
DONE
18+
--EXPECT--
19+
DONE

0 commit comments

Comments
 (0)