1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 11:13:36 +02:00
Files
archived-php-src/ext/standard/tests/general_functions/bug41970.phpt
T
Máté Kocsis 960318ed95 Change argument error message format
Closes GH-5211
2020-02-26 15:00:08 +01:00

32 lines
793 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)));
try {
var_dump(call_user_func_array("strlen", array($a)));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
var_dump(call_user_func("sort", $a));
try {
var_dump(call_user_func("strlen", $a));
} catch (TypeError $e) {
echo $e->getMessage(), "\n";
}
echo "Done\n";
?>
--EXPECTF--
Warning: sort(): Argument #1 ($arg) must be passed by reference, value given in %s on line %d
bool(true)
strlen(): Argument #1 ($str) must be of type string, array given
Warning: sort(): Argument #1 ($arg) must be passed by reference, value given in %s on line %d
bool(true)
strlen(): Argument #1 ($str) must be of type string, array given
Done