diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index 624865b50ea..38124cb3d87 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -2957,6 +2957,13 @@ static int zend_update_type_info(const zend_op_array *op_array, UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def); } break; + case ZEND_ASSIGN_STATIC_PROP_REF: + if ((opline+1)->op1_type == IS_CV) { + opline++; + i++; + UPDATE_SSA_TYPE(MAY_BE_REF, ssa_ops[i].op1_def); + } + break; case ZEND_BIND_GLOBAL: tmp = MAY_BE_REF | MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF; diff --git a/ext/opcache/tests/bug79193.phpt b/ext/opcache/tests/bug79193.phpt new file mode 100644 index 00000000000..c500400363a --- /dev/null +++ b/ext/opcache/tests/bug79193.phpt @@ -0,0 +1,18 @@ +--TEST-- +Bug #79193: Incorrect type inference for self::$field =& $field +--FILE-- + +--EXPECT-- +bool(true)