summaryrefslogtreecommitdiff
path: root/ext/standard/tests/serialize/unserialize_mem_leak.phpt
blob: 2a295d83b9992ff8f26e9d0ccf2c076c64ee0c5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--TEST--
Memleaks if unserialize return a self-referenced array/object
--INI--
report_memleaks=1
--FILE--
<?php
function foo() {
	gc_collect_cycles();
}

$str = 'a:1:{i:0;R:1;}';
foo(unserialize($str));
$str = 'a:1:{i:0;r:1;}';
foo(unserialize($str));
echo "okey";
?>
--EXPECTF--
Notice: unserialize(): Error at offset %d of %d bytes in %sunserialize_mem_leak.php on line 9
okey