1--TEST-- 2Test array_diff_uassoc() function : usage variation -Passing classWithoutToString (handling fatal error) to callback 3--FILE-- 4<?php 5/* Prototype : array array_diff_uassoc(array arr1, array arr2 [, array ...], callback key_comp_func) 6 * Description: Computes the difference of arrays with additional index check which is performed by a 7 * user supplied callback function 8 * Source code: ext/standard/array.c 9 */ 10 11echo "*** Testing array_diff_uassoc() : usage variation ***\n"; 12 13//Initialize array 14$array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red"); 15$array2 = array("a" => "green", "yellow", "red"); 16 17class classWithoutToString 18{ 19} 20 21// Define error handler 22function test_error_handler($err_no, $err_msg, $filename, $linenum, $vars) { 23 if (error_reporting() != 0) { 24 // report non-silenced errors 25 echo "Error: $err_no - $err_msg, $filename($linenum)\n"; 26 } 27} 28set_error_handler('test_error_handler'); 29 30$value = new classWithoutToString(); 31var_dump( array_diff_uassoc($array1, $array2, $value) ); 32 33?> 34===DONE=== 35--EXPECTF-- 36*** Testing array_diff_uassoc() : usage variation *** 37Error: 2 - array_diff_uassoc() expects parameter 3 to be a valid callback, no array or string given, %s(%d) 38NULL 39===DONE=== 40 41