1--TEST--
2Test array_intersect_ukey() function : usage variation - Passing non-existing function name to callback
3--FILE--
4<?php
5/* Prototype  : array array_intersect_ukey(array arr1, array arr2 [, array ...], callback key_compare_func)
6 * Description: Computes the intersection of arrays using a callback function on the keys for comparison.
7 * Source code: ext/standard/array.c
8 */
9
10echo "*** Testing array_intersect_ukey() : usage variation ***\n";
11
12//Initialise arguments
13$array1 = array('blue'  => 1, 'red'  => 2, 'green'  => 3, 'purple' => 4);
14$array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan'   => 8);
15
16//function name within double quotes
17var_dump( array_intersect_ukey($array1, $array2, "unknown_function") );
18
19//function name within single quotes
20var_dump( array_intersect_ukey($array1, $array2, 'unknown_function') );
21
22//function name without quotes
23var_dump( array_intersect_ukey($array1, $array2, unknown_function) );
24?>
25===DONE===
26--EXPECTF--
27*** Testing array_intersect_ukey() : usage variation ***
28
29Warning: array_intersect_ukey() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name in %s on line %d
30NULL
31
32Warning: array_intersect_ukey() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name in %s on line %d
33NULL
34
35Warning: Use of undefined constant unknown_function - assumed 'unknown_function' (this will throw an Error in a future version of PHP) in %s on line %d
36
37Warning: array_intersect_ukey() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name in %s on line %d
38NULL
39===DONE===
40