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 (11 years, 8 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

    1: --TEST--
    2: Bug #63055 (Segfault in zend_gc with SF2 testsuite)
    3: --FILE--
    4: <?php
    5: /* the default gc root size is 10,000 */
    6: for ($i=0; $i<9998; $i++) {
    7:     $array = array();
    8:     $array[0] = &$array;
    9:     unset($array);
   10: }
   11: 
   12: $matches = array("foo" => "bar"); /* this bucket will trigger the segfault */
   13: $dummy   = array("dummy");        /* used to trigger gc_collect_cycles */
   14: $dummy[1] = &$dummy;
   15: 
   16: $matches[1] = &$matches;
   17: $matches[2] = $dummy;
   18: 
   19: str_replace("foo", "bar", "foobar", $matches);
   20: echo "okey";
   21: ?>
   22: --EXPECTF--
   23: okey

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