xref: /PHP-8.1/Zend/tests/bug79979.phpt (revision 25f1c405)
1--TEST--
2Bug #79979 (passing value to by-ref param via CUF(A) crashes)
3--FILE--
4<?php
5
6namespace Foo;
7
8call_user_func_array("str_replace", ["a", "b", "c", new \stdClass]);
9call_user_func_array("str_replace", ["a", "b", "c", "count" => new \stdClass]);
10
11\call_user_func_array("str_replace", ["a", "b", "c", new \stdClass]);
12\call_user_func_array("str_replace", ["a", "b", "c", "count" => new \stdClass]);
13
14?>
15--EXPECTF--
16Warning: str_replace(): Argument #4 ($count) must be passed by reference, value given in %s on line %d
17
18Warning: str_replace(): Argument #4 ($count) must be passed by reference, value given in %s on line %d
19
20Warning: str_replace(): Argument #4 ($count) must be passed by reference, value given in %s on line %d
21
22Warning: str_replace(): Argument #4 ($count) must be passed by reference, value given in %s on line %d
23