mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix GH-20073: Assertion failure in WeakMap offset operations on reference
Closes GH-20078.
This commit is contained in:
2
NEWS
2
NEWS
@@ -4,6 +4,8 @@ PHP NEWS
|
||||
|
||||
- Core:
|
||||
. Fixed bug GH-19934 (CGI with auto_globals_jit=0 causes uouv). (ilutov)
|
||||
. Fixed bug GH-20073 (Assertion failure in WeakMap offset operations on
|
||||
reference). (nielsdos)
|
||||
|
||||
23 Oct 2025, PHP 8.3.27
|
||||
|
||||
|
||||
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)
|
||||
@@ -702,7 +702,7 @@ ZEND_METHOD(WeakMap, offsetGet)
|
||||
return;
|
||||
}
|
||||
|
||||
ZVAL_COPY(return_value, zv);
|
||||
RETURN_COPY_DEREF(zv);
|
||||
}
|
||||
|
||||
ZEND_METHOD(WeakMap, offsetSet)
|
||||
|
||||
Reference in New Issue
Block a user