File:  [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests / bug63055.phpt
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs - revision graph
Mon Jul 22 01:32:17 2013 UTC (10 years, 11 months ago) by misho
Branches: php, MAIN
CVS tags: v5_4_29p0, v5_4_29, v5_4_20p0, v5_4_20, v5_4_17, HEAD
5.4.17

--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;

str_replace("foo", "bar", "foobar", $matches);
echo "okey";
?>
--EXPECTF--
okey

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>