mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: Fix GH-20073: Assertion failure in WeakMap offset operations on reference
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)
|
||||
|
||||
09 Oct 2025, PHP 8.4.14
|
||||
|
||||
|
||||
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)
|
||||
@@ -722,7 +722,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