1--TEST--
2Memleaks if unserialize return a self-referenced array/object
3--INI--
4report_memleaks=1
5--FILE--
6<?php
7function foo() {
8    gc_collect_cycles();
9}
10
11$str = 'a:1:{i:0;R:1;}';
12foo(unserialize($str));
13$str = 'a:1:{i:0;r:1;}';
14foo(unserialize($str));
15echo "okey";
16?>
17--EXPECTF--
18Notice: unserialize(): Error at offset %d of %d bytes in %sunserialize_mem_leak.php on line 9
19okey
20