bug63055.phpt 540 B

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