summaryrefslogtreecommitdiff
path: root/ext/pcre/tests/bug63055.phpt
blob: 16c50b54e5e2b46a0b716a03acca5eab1f4640b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--TEST--
Bug #63055 (Segfault in zend_gc with SF2 testsuite)
--FILE--
<?php
/* the default gc root size is 10,000 */
for ($i=0; $i<9998; $i++) {
    $array = array();
    $array[0] = &$array;
    unset($array);
}

$matches = array("foo" => "bar"); /* this bucket will trigger the segfault */
$dummy   = array("dummy");        /* used to trigger gc_collect_cycles */
$dummy[1] = &$dummy;

$matches[1] = &$matches;
$matches[2] = $dummy;

preg_match_all("/(\d)+/", "foo123456bar", $matches);
echo "okey";
?>
--EXPECTF--
okey