php-src/Zend/tests/bug79979.phpt
Nikita Popov 7a6ae9b148 Fix refcounting for the named params case as well
Adjust the test case to pass a refcounted value and to also check
the named params case.
2020-08-24 16:30:49 +02:00

23 lines
883 B
PHP

--TEST--
Bug #79979 (passing value to by-ref param via CUF(A) crashes)
--FILE--
<?php
namespace Foo;
call_user_func_array("str_replace", ["a", "b", "c", new \stdClass]);
call_user_func_array("str_replace", ["a", "b", "c", "replace_count" => new \stdClass]);
\call_user_func_array("str_replace", ["a", "b", "c", new \stdClass]);
\call_user_func_array("str_replace", ["a", "b", "c", "replace_count" => new \stdClass]);
?>
--EXPECTF--
Warning: str_replace(): Argument #4 ($replace_count) must be passed by reference, value given in %s on line %d
Warning: str_replace(): Argument #4 ($replace_count) must be passed by reference, value given in %s on line %d
Warning: str_replace(): Argument #4 ($replace_count) must be passed by reference, value given in %s on line %d
Warning: str_replace(): Argument #4 ($replace_count) must be passed by reference, value given in %s on line %d