1--TEST-- 2Test array_intersect_ukey() function : usage variation - Passing non-existing function name to callback 3--FILE-- 4<?php 5echo "*** Testing array_intersect_ukey() : usage variation ***\n"; 6 7//Initialise arguments 8$array1 = array('blue' => 1, 'red' => 2, 'green' => 3, 'purple' => 4); 9$array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8); 10 11//function name within double quotes 12try { 13 var_dump( array_intersect_ukey($array1, $array2, "unknown_function") ); 14} catch (TypeError $e) { 15 echo $e->getMessage(), "\n"; 16} 17 18//function name within single quotes 19try { 20 var_dump( array_intersect_ukey($array1, $array2, 'unknown_function') ); 21} catch (TypeError $e) { 22 echo $e->getMessage(), "\n"; 23} 24 25?> 26--EXPECT-- 27*** Testing array_intersect_ukey() : usage variation *** 28array_intersect_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name 29array_intersect_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name 30