mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4: Fix GH-20073: Assertion failure in WeakMap offset operations on reference
This commit is contained in:
15
Zend/tests/weakrefs/gh20073.phpt
Normal file
15
Zend/tests/weakrefs/gh20073.phpt
Normal file
@@ -0,0 +1,15 @@
|
||||
--TEST--
|
||||
GH-20073 (Assertion failure in WeakMap offset operations on reference)
|
||||
--FILE--
|
||||
<?php
|
||||
$obj = new stdClass;
|
||||
$map = new WeakMap;
|
||||
$integer = 1;
|
||||
$map[$obj] = 0;
|
||||
$map[$obj] =& $integer;
|
||||
$integer++;
|
||||
var_dump($map[$obj], $map->offsetGet($obj));
|
||||
?>
|
||||
--EXPECT--
|
||||
int(2)
|
||||
int(2)
|
||||
@@ -731,7 +731,7 @@ ZEND_METHOD(WeakMap, offsetGet)
|
||||
RETURN_THROWS();
|
||||
}
|
||||
|
||||
ZVAL_COPY(return_value, zv);
|
||||
RETURN_COPY_DEREF(zv);
|
||||
}
|
||||
|
||||
ZEND_METHOD(WeakMap, offsetSet)
|
||||
|
||||
Reference in New Issue
Block a user