xref: /PHP-7.3/ext/pcre/tests/bug73612.phpt (revision 85290bbf)
1--TEST--
2Bug #73612 (preg_*() may leak memory)
3--FILE--
4<?php
5$obj = new stdClass;
6$obj->obj = $obj;
7preg_match('/./', 'x', $obj);
8
9$obj = new stdClass;
10$obj->obj = $obj;
11preg_replace('/./', '', 'x', -1, $obj);
12
13$obj = new stdClass;
14$obj->obj = $obj;
15preg_replace_callback('/./', 'count', 'x', -1, $obj);
16
17$obj = new stdClass;
18$obj->obj = $obj;
19preg_replace_callback_array(['/./' => 'count'], 'x', -1, $obj);
20
21$obj = new stdClass;
22$obj->obj = $obj;
23preg_filter('/./', '', 'x', -1, $obj);
24?>
25===DONE===
26--EXPECT--
27===DONE===
28