case ZEND_FETCH_DIM_W:
case ZEND_FETCH_DIM_RW:
case ZEND_FETCH_DIM_FUNC_ARG:
+ case ZEND_ASSIGN_DIM:
+ tmp |= MAY_BE_ARRAY | MAY_BE_ARRAY_OF_ARRAY;
+ break;
case ZEND_ASSIGN_ADD:
case ZEND_ASSIGN_SUB:
case ZEND_ASSIGN_MUL:
case ZEND_ASSIGN_BW_AND:
case ZEND_ASSIGN_BW_XOR:
case ZEND_ASSIGN_POW:
- case ZEND_ASSIGN_DIM:
- tmp |= MAY_BE_ARRAY | MAY_BE_ARRAY_OF_ARRAY;
+ if (op_array->opcodes[j].extended_value == ZEND_ASSIGN_DIM) {
+ tmp |= MAY_BE_ARRAY | MAY_BE_ARRAY_OF_ARRAY;
+ } else if (op_array->opcodes[j].extended_value == ZEND_ASSIGN_OBJ) {
+ tmp |= MAY_BE_ARRAY_OF_OBJECT;
+ }
break;
case ZEND_FETCH_OBJ_W:
case ZEND_FETCH_OBJ_RW:
--- /dev/null
+--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)