Skip to content

Commit 8262329

Browse files
committed
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0: JIT: Fixed numeric string index handling
2 parents be8c9b9 + f1e6a7d commit 8262329

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

ext/opcache/jit/zend_jit_helpers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static zval* ZEND_FASTCALL zend_jit_symtable_lookup_rw(HashTable *ht, zend_strin
303303
if (_zend_handle_numeric_str_ex(str->val, str->len, &idx)) {
304304
retval = zend_hash_index_find(ht, idx);
305305
if (!retval) {
306-
retval = zend_undefined_index_write(ht, str);
306+
retval = zend_undefined_offset_write(ht, idx);
307307
}
308308
return retval;
309309
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
JIT FETCH_DIM_RW: 002
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
opcache.file_update_protection=0
7+
opcache.jit_buffer_size=1M
8+
--FILE--
9+
<?php
10+
$a = [];
11+
$k = "0";
12+
$a[$k]++;
13+
var_dump($a[$k]);
14+
?>
15+
--EXPECTF--
16+
Warning: Undefined array key 0 in %sfetch_dim_rw_002.php on line 4
17+
int(1)

0 commit comments

Comments
 (0)