Skip to content

Commit e4935cf

Browse files
Merge branch 'PHP-8.5'
* PHP-8.5: Core: fix missing deprecation when accessing null array key with JIT (#20883)
2 parents 7fed075 + 4a6e607 commit e4935cf

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ PHP NEWS
1111
. Fix OSS-Fuzz #429429090 (Failed assertion on unset() with uninitialized
1212
container). (ilutov)
1313
. Fixed GH-20564 (Don't call autoloaders with pending exception). (ilutov)
14+
. Fix deprecation now showing when accessing null key of an array with JIT.
15+
(alexandre-daubois)
1416

1517
- Date:
1618
. Update timelib to 2022.16. (Derick)

Zend/Optimizer/sccp.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,7 @@ static inline zend_result zval_to_string_offset(zend_long *result, zval *op) {
363363
static inline zend_result fetch_array_elem(zval **result, zval *op1, zval *op2) {
364364
switch (Z_TYPE_P(op2)) {
365365
case IS_NULL:
366-
*result = zend_hash_find(Z_ARR_P(op1), ZSTR_EMPTY_ALLOC());
367-
return SUCCESS;
366+
return FAILURE;
368367
case IS_FALSE:
369368
*result = zend_hash_index_find(Z_ARR_P(op1), 0);
370369
return SUCCESS;

ext/opcache/tests/jit/fetch_dim_r_001.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,16 @@ function foo() {
3030
}
3131
foo();
3232
?>
33-
--EXPECT--
33+
--EXPECTF--
3434
int(1)
3535
int(3)
3636
int(2)
3737
int(1)
3838
int(3)
3939
int(1)
4040
int(2)
41+
42+
Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d
4143
int(4)
4244
int(5)
4345
int(5)

0 commit comments

Comments
 (0)