diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index 4351fe20199..7aa4d577bc1 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -3530,6 +3530,10 @@ static zend_always_inline int _zend_update_type_info( tmp &= ~MAY_BE_RC1; } } + if (opline->opcode == ZEND_FETCH_OBJ_IS) { + /* IS check may return null for uninitialized typed property. */ + tmp |= MAY_BE_NULL; + } } UPDATE_SSA_TYPE(tmp, ssa_op->result_def); if (ce) { diff --git a/ext/opcache/tests/jit/fetch_obj_is_typed_prop.phpt b/ext/opcache/tests/jit/fetch_obj_is_typed_prop.phpt new file mode 100644 index 00000000000..e237bb13aac --- /dev/null +++ b/ext/opcache/tests/jit/fetch_obj_is_typed_prop.phpt @@ -0,0 +1,24 @@ +--TEST-- +FETCH_OBJ_IS on typed object property +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit_buffer_size=1M +--FILE-- +data[0])); +} + +test(); + +?> +--EXPECT-- +bool(false)