1--TEST-- 2Bug #41970 (call_user_func_*() leaks on failure) 3--FILE-- 4<?php 5 6$a = array(4,3,2); 7 8var_dump(call_user_func_array("sort", array($a))); 9try { 10 var_dump(call_user_func_array("strlen", array($a))); 11} catch (TypeError $e) { 12 echo $e->getMessage(), "\n"; 13} 14var_dump(call_user_func("sort", $a)); 15try { 16 var_dump(call_user_func("strlen", $a)); 17} catch (TypeError $e) { 18 echo $e->getMessage(), "\n"; 19} 20 21echo "Done\n"; 22?> 23--EXPECTF-- 24Warning: sort(): Argument #1 ($array) must be passed by reference, value given in %s on line %d 25bool(true) 26strlen(): Argument #1 ($string) must be of type string, array given 27 28Warning: sort(): Argument #1 ($array) must be passed by reference, value given in %s on line %d 29bool(true) 30strlen(): Argument #1 ($string) must be of type string, array given 31Done 32