1--TEST--
2Test array_diff_ukey() function : usage variation - Passing non-existing function name to callback
3--FILE--
4<?php
5/* Prototype  : array array_diff_ukey(array arr1, array arr2 [, array ...], callback key_comp_func)
6 * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments.
7 * Source code: ext/standard/array.c
8 */
9
10echo "*** Testing array_diff_ukey() : usage variation ***\n";
11
12//Initialize variables
13$array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red");
14$array2 = array("a" => "green", "yellow", "red");
15
16//function name within double quotes
17var_dump( array_diff_ukey($array1, $array1, "unknown_function") );
18
19//function name within single quotes
20var_dump( array_diff_ukey($array1, $array1, 'unknown_function') );
21
22//function name without quotes
23var_dump( array_diff_ukey($array1, $array1, unknown_function) );
24
25?>
26===DONE===
27--EXPECTF--
28*** Testing array_diff_ukey() : usage variation ***
29
30Warning: array_diff_ukey() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name in %s on line %d
31NULL
32
33Warning: array_diff_ukey() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name in %s on line %d
34NULL
35
36Notice: Use of undefined constant unknown_function - assumed 'unknown_function' in %s on line %d
37
38Warning: array_diff_ukey() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name in %s on line %d
39NULL
40===DONE===
41