1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 10:16:41 +02:00
Files
archived-php-src/ext/standard/tests/general_functions/bug41970.phpt
T
Nikita Popov 906456c410 call_user_func(_array): Don't abort on reference warning
Change zend_call_function() to not abort the call if a non-reference
is passed to a reference argument. The usual warning will still be
thrown, but the call will proceed as usual.
2016-08-23 10:29:15 +03:00

28 lines
729 B
PHP

--TEST--
Bug #41970 (call_user_func_*() leaks on failure)
--FILE--
<?php
$a = array(4,3,2);
var_dump(call_user_func_array("sort", array($a)));
var_dump(call_user_func_array("strlen", array($a)));
var_dump(call_user_func("sort", $a));
var_dump(call_user_func("strlen", $a));
echo "Done\n";
?>
--EXPECTF--
Warning: Parameter 1 to sort() expected to be a reference, value given in %sbug41970.php on line 5
bool(true)
Warning: strlen() expects parameter 1 to be string, array given in %sbug41970.php on line 6
NULL
Warning: Parameter 1 to sort() expected to be a reference, value given in %sbug41970.php on line 7
bool(true)
Warning: strlen() expects parameter 1 to be string, array given in %sbug41970.php on line 8
NULL
Done