mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.3'
* PHP-8.3: jit: fixed "Uninitialized string offset" warning being emitted at the same time as invalid offset Error
This commit is contained in:
@@ -1100,6 +1100,9 @@ static zend_string* ZEND_FASTCALL zend_jit_fetch_dim_str_r_helper(zend_string *s
|
||||
} else {
|
||||
offset = Z_LVAL_P(dim);
|
||||
}
|
||||
if (UNEXPECTED(EG(exception) != NULL)) {
|
||||
return ZSTR_EMPTY_ALLOC();
|
||||
}
|
||||
return zend_jit_fetch_dim_str_offset(str, offset);
|
||||
}
|
||||
|
||||
|
||||
20
ext/opcache/tests/jit/gh12723-A.phpt
Normal file
20
ext/opcache/tests/jit/gh12723-A.phpt
Normal file
@@ -0,0 +1,20 @@
|
||||
--TEST--
|
||||
GH-12723: Function JIT emits "Uninitialized string offset" warning at the same time as invalid offset Error
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$container = '';
|
||||
$dimension = [];
|
||||
|
||||
try {
|
||||
var_dump($container[$dimension]);
|
||||
} catch (\Throwable $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Cannot access offset of type array on string
|
||||
Reference in New Issue
Block a user