diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c index 3ac243c30a3..a224ce605ca 100644 --- a/ext/opcache/Optimizer/zend_inference.c +++ b/ext/opcache/Optimizer/zend_inference.c @@ -2938,6 +2938,9 @@ static zend_always_inline int _zend_update_type_info( } break; case ZEND_ASSIGN_STATIC_PROP_REF: + if (ssa_op->result_def >= 0) { + UPDATE_SSA_TYPE(MAY_BE_REF, ssa_op->result_def); + } if ((opline+1)->op1_type == IS_CV) { opline++; ssa_op++; diff --git a/ext/opcache/tests/assign_static_prop_ref_result.phpt b/ext/opcache/tests/assign_static_prop_ref_result.phpt new file mode 100644 index 00000000000..7fef0d05e95 --- /dev/null +++ b/ext/opcache/tests/assign_static_prop_ref_result.phpt @@ -0,0 +1,14 @@ +--TEST-- +ASSIGN_STATIC_PROP_REF result should have live range +--FILE-- + +--EXPECTF-- +Fatal error: Uncaught Error: Undefined constant "UNDEF" in %s:%d +Stack trace: +#0 {main} + thrown in %s on line %d