xref: /PHP-8.4/Zend/tests/gh13569.phpt (revision 6b57e2d9)
1--TEST--
2GH-13569: GC buffer grows up to GC_MAX_BUF_SIZE when scanning WeakMaps
3--FILE--
4<?php
5
6$wm = new WeakMap();
7$objs = [];
8for ($i = 0; $i < 30_000; $i++) {
9    $objs[] = $obj = new stdClass;
10    $wm[$obj] = $obj;
11}
12
13gc_collect_cycles();
14
15$tmp = $wm;
16$tmp = null;
17
18gc_collect_cycles();
19?>
20==DONE==
21--EXPECT--
22==DONE==
23