Skip to content

Commit c2e77f9

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1: [ci skip] NEWS Fix GH-10248: Assertion `!(zval_get_type(&(*(property))) == 10)' failed.
2 parents cc931af + f673449 commit c2e77f9

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

Zend/zend_vm_def.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2130,6 +2130,7 @@ ZEND_VM_C_LABEL(fetch_obj_r_fast_copy):
21302130
#if ZEND_DEBUG
21312131
if (!EG(exception) && prop_info && prop_info != ZEND_WRONG_PROPERTY_INFO
21322132
&& ZEND_TYPE_IS_SET(prop_info->type)) {
2133+
ZVAL_OPT_DEREF(retval);
21332134
zend_verify_property_type(prop_info, retval, /* strict */ true);
21342135
}
21352136
#endif

Zend/zend_vm_execute.h

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/spl/tests/gh10248.phpt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--TEST--
2+
GH-10248 (Assertion `!(zval_get_type(&(*(property))) == 10)' failed.)
3+
--FILE--
4+
<?php
5+
6+
class a extends ArrayIterator
7+
{
8+
public ?int $property;
9+
}
10+
$a = new a();
11+
$a->property = &$b;
12+
$a->property;
13+
14+
echo "Done\n";
15+
16+
?>
17+
--EXPECT--
18+
Done

0 commit comments

Comments
 (0)