summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-07-05 11:41:57 +0200
committerNikita Popov <nikita.ppv@gmail.com>2019-07-05 11:41:57 +0200
commit10861987118aefbfa715b8a0eeb464a21dfa1ec9 (patch)
tree81b6e9f2be1d39a56627ae0da3d4a7701999741f /ext
parentea86a9209c0cf6e39f364d6a5cf0ed07addbf3f9 (diff)
parent920283ff2b02de4a8affc48c75e5481c381ca56e (diff)
downloadphp-git-10861987118aefbfa715b8a0eeb464a21dfa1ec9.tar.gz
Merge branch 'PHP-7.3' into PHP-7.4
Diffstat (limited to 'ext')
-rw-r--r--ext/opcache/Optimizer/zend_inference.c6
-rw-r--r--ext/opcache/tests/assign_obj_op_of_fetch_dim.phpt20
2 files changed, 22 insertions, 4 deletions
diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c
index ed9fc4878c..a80eb58a08 100644
--- a/ext/opcache/Optimizer/zend_inference.c
+++ b/ext/opcache/Optimizer/zend_inference.c
@@ -3414,17 +3414,15 @@ static int zend_update_type_info(const zend_op_array *op_array,
case ZEND_FETCH_DIM_RW:
case ZEND_FETCH_DIM_FUNC_ARG:
case ZEND_FETCH_LIST_W:
- case ZEND_ASSIGN_OP:
- case ZEND_ASSIGN_DIM_OP:
- case ZEND_ASSIGN_OBJ_OP:
- case ZEND_ASSIGN_STATIC_PROP_OP:
case ZEND_ASSIGN_DIM:
+ case ZEND_ASSIGN_DIM_OP:
tmp |= MAY_BE_ARRAY | MAY_BE_ARRAY_OF_ARRAY;
break;
case ZEND_FETCH_OBJ_W:
case ZEND_FETCH_OBJ_RW:
case ZEND_FETCH_OBJ_FUNC_ARG:
case ZEND_ASSIGN_OBJ:
+ case ZEND_ASSIGN_OBJ_OP:
case ZEND_ASSIGN_OBJ_REF:
case ZEND_PRE_INC_OBJ:
case ZEND_PRE_DEC_OBJ:
diff --git a/ext/opcache/tests/assign_obj_op_of_fetch_dim.phpt b/ext/opcache/tests/assign_obj_op_of_fetch_dim.phpt
new file mode 100644
index 0000000000..c89d0bea62
--- /dev/null
+++ b/ext/opcache/tests/assign_obj_op_of_fetch_dim.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Type inference for $ary[$idx]->prop +=
+--FILE--
+<?php
+
+function test() {
+ $ary = [];
+ $ary[0]->y += 2;
+ var_dump(is_object($ary[0]));
+}
+test();
+
+?>
+--EXPECTF--
+Notice: Undefined offset: 0 in %s on line %d
+
+Warning: Creating default object from empty value in %s on line %d
+
+Notice: Undefined property: stdClass::$y in %s on line %d
+bool(true)