Skip to content

Commit 298bba5

Browse files
committed
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
2 parents bd2c970 + c70219e commit 298bba5

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

ext/opcache/jit/zend_jit_helpers.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1587,7 +1587,9 @@ static void ZEND_FASTCALL zend_jit_assign_dim_op_helper(zval *container, zval *d
15871587
}
15881588
zval_ptr_dtor(&res);
15891589
} else {
1590-
zend_error(E_WARNING, "Attempt to assign property of non-object");
1590+
/* Exception is thrown in this case */
1591+
GC_DELREF(obj);
1592+
return;
15911593
}
15921594
if (UNEXPECTED(GC_DELREF(obj) == 0)) {
15931595
zend_objects_store_del(obj);

ext/opcache/tests/jit/gh12723-B.phpt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
GH-12723: JIT emits "Attempt to assign property of non-object" warning at the same time as Error is being thrown
3+
--INI--
4+
opcache.enable=1
5+
opcache.enable_cli=1
6+
--FILE--
7+
<?php
8+
9+
$container = new stdClass();
10+
11+
try {
12+
$container[new stdClass()] .= 'append';
13+
} catch (\Throwable $e) {
14+
echo $e->getMessage(), "\n";
15+
}
16+
17+
?>
18+
--EXPECT--
19+
Cannot use object of type stdClass as array

0 commit comments

Comments
 (0)