Annotation of embedaddon/php/ext/standard/tests/array/array_intersect_ukey_variation8.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test 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:
10: echo "*** 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
17: var_dump( array_intersect_ukey($array1, $array2, "unknown_function") );
18:
19: //function name within single quotes
20: var_dump( array_intersect_ukey($array1, $array2, 'unknown_function') );
21:
22: //function name without quotes
23: var_dump( array_intersect_ukey($array1, $array2, unknown_function) );
24: ?>
25: ===DONE===
26: --EXPECTF--
27: *** Testing array_intersect_ukey() : usage variation ***
28:
29: Warning: 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
30: NULL
31:
32: Warning: 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
33: NULL
34:
35: Notice: Use of undefined constant unknown_function - assumed 'unknown_function' in %s on line %d
36:
37: Warning: 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
38: NULL
39: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>