1
0
mirror of https://github.com/php/php-src.git synced 2026-04-10 09:33:06 +02:00
Files
archived-php-src/Zend/tests/bug79979.phpt
Christoph M. Becker 6b6c2c003c Fix #79979: passing value to by-ref param via CUFA crashes
If a by-val send is not allowed, we must not do so.  Instead we wrap
the value in a temporary reference.

Closes GH-6000
2020-08-24 14:08:32 +02:00

18 lines
587 B
PHP

--TEST--
Bug #79979 (passing value to by-ref param via CUF(A) crashes)
--FILE--
<?php
call_user_func_array("str_replace", ["a", "b", "c", 0]);
$cufa = "call_user_func_array";
$cufa("str_replace", ["a", "b", "c", 0]);
call_user_func_array($cufa, ["str_replace", ["a", "b", "c", 0]]);
?>
--EXPECTF--
Warning: Parameter 4 to str_replace() expected to be a reference, value given in %s on line %d
Warning: Parameter 4 to str_replace() expected to be a reference, value given in %s on line %d
Warning: Parameter 4 to str_replace() expected to be a reference, value given in %s on line %d