1--TEST--
2Test array_intersect_uassoc() function : usage variation - Passing non-existing function name to callback
3--FILE--
4<?php
5/* Prototype  : array array_intersect_uassoc(array arr1, array arr2 [, array ...], callback key_compare_func)
6 * Description: Computes the intersection of arrays with additional index check, compares indexes by a callback function
7 * Source code: ext/standard/array.c
8 */
9
10echo "*** Testing array_intersect_uassoc() : 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_intersect_uassoc($array1, $array2, "unknown_function") );
18
19//function name within single quotes
20var_dump( array_intersect_uassoc($array1, $array2, 'unknown_function') );
21
22//function name without quotes
23var_dump( array_intersect_uassoc($array1, $array2, unknown_function) );
24?>
25===DONE===
26--EXPECTF--
27*** Testing array_intersect_uassoc() : usage variation ***
28
29Warning: array_intersect_uassoc() 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_uassoc() expects parameter 3 to be a valid callback, function 'unknown_function' not found or invalid function name in %s on line %d
33NULL
34
35Notice: Use of undefined constant unknown_function - assumed 'unknown_function' in %s on line %d
36
37Warning: array_intersect_uassoc() 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