1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 15:38:49 +02:00
Files
archived-php-src/Zend/tests/weakrefs/weakmap_dtor_exception.phpt
T
Nikita Popov a4b209fdcf Make weak ref notify robust against bailout
First drop it from EG(weakrefs), as the weakref_unref operation
may call a destructor, which may bail out.

Fixes oss-fuzz #39718.
2021-10-08 16:42:43 +02:00

19 lines
382 B
PHP

--TEST--
Exception during WeakMap destruction during shutdown
--FILE--
<?php
$map = new WeakMap;
$obj = new stdClass;
$map[$obj] = new class {
function __destruct() {
throw new Exception("Test");
}
};
?>
--EXPECTF--
Fatal error: Uncaught Exception: Test in %s:%d
Stack trace:
#0 [internal function]: class@anonymous->__destruct()
#1 {main}
thrown in %s on line %d