php-src/Zend/tests/weakrefs/gh10043-015.phpt

25 lines
305 B
PHP

--TEST--
Self-referencing map entry GC - 015
--FILE--
<?php
class Value {
public function __construct() {
}
}
$map = new WeakMap();
$obj = new Value();
$map[$obj] = [$obj, $map];
$ref = WeakReference::create($map);
$map = null;
gc_collect_cycles();
var_dump($ref->get());
?>
--EXPECT--
NULL