php-src/Zend/tests/bug63055.phpt
Gabriel Caruso ded3d984c6 Use EXPECT instead of EXPECTF when possible
EXPECTF logic in run-tests.php is considerable, so let's avoid it.
2018-02-20 21:53:48 +01:00

26 lines
540 B
PHP

--TEST--
Bug #63055 (Segfault in zend_gc with SF2 testsuite)
--INI--
zend.enable_gc=1
--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";
?>
--EXPECT--
okey