Skip to content

Commit 8ae9e1b

Browse files
committed
Merge branch 'PHP-7.4'
2 parents 57a385d + 1086198 commit 8ae9e1b

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

ext/opcache/Optimizer/zend_inference.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3412,17 +3412,15 @@ static int zend_update_type_info(const zend_op_array *op_array,
34123412
case ZEND_FETCH_DIM_RW:
34133413
case ZEND_FETCH_DIM_FUNC_ARG:
34143414
case ZEND_FETCH_LIST_W:
3415-
case ZEND_ASSIGN_OP:
3416-
case ZEND_ASSIGN_DIM_OP:
3417-
case ZEND_ASSIGN_OBJ_OP:
3418-
case ZEND_ASSIGN_STATIC_PROP_OP:
34193415
case ZEND_ASSIGN_DIM:
3416+
case ZEND_ASSIGN_DIM_OP:
34203417
tmp |= MAY_BE_ARRAY | MAY_BE_ARRAY_OF_ARRAY;
34213418
break;
34223419
case ZEND_FETCH_OBJ_W:
34233420
case ZEND_FETCH_OBJ_RW:
34243421
case ZEND_FETCH_OBJ_FUNC_ARG:
34253422
case ZEND_ASSIGN_OBJ:
3423+
case ZEND_ASSIGN_OBJ_OP:
34263424
case ZEND_ASSIGN_OBJ_REF:
34273425
case ZEND_PRE_INC_OBJ:
34283426
case ZEND_PRE_DEC_OBJ:
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
--TEST--
2+
Type inference for $ary[$idx]->prop +=
3+
--FILE--
4+
<?php
5+
6+
function test() {
7+
$ary = [];
8+
$ary[0]->y += 2;
9+
var_dump(is_object($ary[0]));
10+
}
11+
test();
12+
13+
?>
14+
--EXPECTF--
15+
Notice: Undefined offset: 0 in %s on line %d
16+
17+
Warning: Creating default object from empty value in %s on line %d
18+
19+
Notice: Undefined property: stdClass::$y in %s on line %d
20+
bool(true)

0 commit comments

Comments
 (0)