mirror of
https://github.com/php/php-src.git
synced 2026-04-29 11:13:36 +02:00
960318ed95
Closes GH-5211
32 lines
793 B
PHP
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
|