diff --git a/Zend/Optimizer/zend_inference.c b/Zend/Optimizer/zend_inference.c index d51379a9ba6..b24aa60b9f9 100644 --- a/Zend/Optimizer/zend_inference.c +++ b/Zend/Optimizer/zend_inference.c @@ -2791,6 +2791,9 @@ static zend_always_inline int _zend_update_type_info( if (t1 & ((MAY_BE_ANY|MAY_BE_UNDEF) - MAY_BE_STRING)) { tmp |= (OP1_DATA_INFO() & (MAY_BE_ANY | MAY_BE_ARRAY_KEY_ANY | MAY_BE_ARRAY_OF_ANY | MAY_BE_ARRAY_OF_REF)); + if (OP1_DATA_INFO() & MAY_BE_UNDEF) { + tmp |= MAY_BE_NULL; + } if (opline->op2_type == IS_UNUSED) { /* When appending to an array and the LONG_MAX key is already used * null will be returned. */ diff --git a/ext/opcache/tests/jit/assign_dim_003.phpt b/ext/opcache/tests/jit/assign_dim_003.phpt new file mode 100644 index 00000000000..6f45fac5f05 --- /dev/null +++ b/ext/opcache/tests/jit/assign_dim_003.phpt @@ -0,0 +1,20 @@ +--TEST-- +JIT ASSIGN_DIM: 003 +--INI-- +opcache.enable=1 +opcache.enable_cli=1 +opcache.file_update_protection=0 +opcache.jit_buffer_size=1M +opcache.jit=tracing +--EXTENSIONS-- +opcache +--FILE-- + +--EXPECTF-- +Warning: Undefined variable $v in %sassign_dim_003.php on line 3 +NULL \ No newline at end of file