1
0
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:
Gina Peter Banyard
2023-11-27 16:07:53 +00:00
2 changed files with 23 additions and 0 deletions

View File

@@ -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);
}

View 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