xref: /PHP-8.1/Zend/tests/gc_036.phpt (revision f8d79582)
1--TEST--
2GC 036: Memleaks in self-referenced array
3--INI--
4zend.enable_gc = 1
5--FILE--
6<?php
7function &foo() {
8    $a = [];
9    $a[] =& $a;
10    return $a;
11}
12function bar() {
13    gc_collect_cycles();
14}
15bar(foo());
16echo "ok\n";
17?>
18--EXPECT--
19ok
20