1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.5'

* PHP-8.5:
  Fix GH-20073: Assertion failure in WeakMap offset operations on reference
This commit is contained in:
Niels Dossche
2025-10-07 20:17:13 +02:00
2 changed files with 16 additions and 1 deletions

View 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)

View File

@@ -731,7 +731,7 @@ ZEND_METHOD(WeakMap, offsetGet)
RETURN_THROWS();
}
ZVAL_COPY(return_value, zv);
RETURN_COPY_DEREF(zv);
}
ZEND_METHOD(WeakMap, offsetSet)