mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.1'
* PHP-8.1: Fix WeakReference uniquing is TAG_HT is used
This commit is contained in:
commit
59d43a4f59
2 changed files with 3 additions and 1 deletions
|
@ -12,6 +12,7 @@ $map2 = new WeakMap;
|
|||
$map2[$obj] = 1;
|
||||
$map3 = clone $map2;
|
||||
|
||||
var_dump($ref === WeakReference::create($obj));
|
||||
var_dump($ref->get(), $map, $map2, $map3);
|
||||
unset($obj);
|
||||
var_dump($ref->get(), $map, $map2, $map3);
|
||||
|
@ -31,6 +32,7 @@ unset($obj);
|
|||
|
||||
?>
|
||||
--EXPECT--
|
||||
bool(true)
|
||||
object(stdClass)#1 (0) {
|
||||
}
|
||||
object(WeakMap)#3 (1) {
|
||||
|
|
|
@ -209,7 +209,7 @@ found_weakref:
|
|||
}
|
||||
|
||||
if (tag == ZEND_WEAKREF_TAG_HT) {
|
||||
ZEND_HASH_FOREACH(ptr, tagged_ptr) {
|
||||
ZEND_HASH_FOREACH_PTR(ptr, tagged_ptr) {
|
||||
if (ZEND_WEAKREF_GET_TAG(tagged_ptr) == ZEND_WEAKREF_TAG_REF) {
|
||||
ptr = ZEND_WEAKREF_GET_PTR(tagged_ptr);
|
||||
goto found_weakref;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue