From 2b1a411806c7b0e5692d5472e4f1da4b002b330e Mon Sep 17 00:00:00 2001 From: Ant Phillips Date: Tue, 2 Dec 2008 13:32:53 +0000 Subject: Array tests: checked on PHP 5.2.6, 5.3 and 6.0 (Windows, Linux and Linux 64 bit). --- .../tests/array/array_diff_uassoc_variation14.phpt | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 ext/standard/tests/array/array_diff_uassoc_variation14.phpt (limited to 'ext/standard/tests/array/array_diff_uassoc_variation14.phpt') diff --git a/ext/standard/tests/array/array_diff_uassoc_variation14.phpt b/ext/standard/tests/array/array_diff_uassoc_variation14.phpt new file mode 100644 index 0000000000..a98a2800da --- /dev/null +++ b/ext/standard/tests/array/array_diff_uassoc_variation14.phpt @@ -0,0 +1,40 @@ +--TEST-- +Test array_diff_uassoc() function : usage variation -Passing classWithoutToString (handling fatal error) to callback +--FILE-- + "green", "b" => "brown", "c" => "blue", "red"); +$array2 = array("a" => "green", "yellow", "red"); + +class classWithoutToString +{ +} + +// Define error handler +function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { + if (error_reporting() != 0) { + // report non-silenced errors + echo "Error: $err_no - $err_msg, $filename($linenum)\n"; + } +} +set_error_handler('test_error_handler'); + +$value = new classWithoutToString(); +var_dump( array_diff_uassoc($array1, $array2, $value) ); + +?> +===DONE=== +--EXPECTF-- +*** Testing array_diff_uassoc() : usage variation *** +Error: 2 - array_diff_uassoc() expects parameter 3 to be a valid callback, no array or string given, %s(%d) +NULL +===DONE=== + -- cgit v1.2.1