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 JIT "Attempt to assign property of non-object" warning emitted at the same time as Error is being thrown
This commit is contained in:
@@ -1587,7 +1587,9 @@ static void ZEND_FASTCALL zend_jit_assign_dim_op_helper(zval *container, zval *d
|
||||
}
|
||||
zval_ptr_dtor(&res);
|
||||
} else {
|
||||
zend_error(E_WARNING, "Attempt to assign property of non-object");
|
||||
/* Exception is thrown in this case */
|
||||
GC_DELREF(obj);
|
||||
return;
|
||||
}
|
||||
if (UNEXPECTED(GC_DELREF(obj) == 0)) {
|
||||
zend_objects_store_del(obj);
|
||||
|
||||
19
ext/opcache/tests/jit/gh12723-B.phpt
Normal file
19
ext/opcache/tests/jit/gh12723-B.phpt
Normal file
@@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
GH-12723: JIT emits "Attempt to assign property of non-object" warning at the same time as Error is being thrown
|
||||
--INI--
|
||||
opcache.enable=1
|
||||
opcache.enable_cli=1
|
||||
--FILE--
|
||||
<?php
|
||||
|
||||
$container = new stdClass();
|
||||
|
||||
try {
|
||||
$container[new stdClass()] .= 'append';
|
||||
} catch (\Throwable $e) {
|
||||
echo $e->getMessage(), "\n";
|
||||
}
|
||||
|
||||
?>
|
||||
--EXPECT--
|
||||
Cannot use object of type stdClass as array
|
||||
Reference in New Issue
Block a user