Annotation of embedaddon/php/ext/standard/tests/array/array_diff_uassoc_variation9.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test array_diff_uassoc() function : usage variation - Passing integer indexed array
3: --FILE--
4: <?php
5: /* Prototype : array array_diff_uassoc(array arr1, array arr2 [, array ...], callback key_comp_func)
6: * Description: Computes the difference of arrays with additional index check which is performed by a
7: * user supplied callback function
8: * Source code: ext/standard/array.c
9: */
10:
11: echo "*** Testing array_diff_uassoc() : usage variation ***\n";
12:
13: // Initialise function arguments not being substituted (if any)
14: $input_array = array(10 => 10, 12 => 12);
15:
16: $input_arrays = array(
17: 'decimal indexed' => array(10 => 10, -17 => -17),
18: 'octal indexed' => array( 012 => 10, -011 => -011,),
19: 'hexa indexed' => array(0xA => 10, -0x7 => -0x7 ),
20: );
21:
22: foreach($input_arrays as $key =>$value) {
23: echo "\n--$key--\n";
24: var_dump( array_diff_uassoc($input_array, $value, "strcasecmp") );
25: var_dump( array_diff_uassoc($value, $input_array, "strcasecmp") );
26: }
27:
28: ?>
29: ===DONE===
30: --EXPECTF--
31: *** Testing array_diff_uassoc() : usage variation ***
32:
33: --decimal indexed--
34: array(1) {
35: [12]=>
36: int(12)
37: }
38: array(1) {
39: [-17]=>
40: int(-17)
41: }
42:
43: --octal indexed--
44: array(1) {
45: [12]=>
46: int(12)
47: }
48: array(1) {
49: [-9]=>
50: int(-9)
51: }
52:
53: --hexa indexed--
54: array(1) {
55: [12]=>
56: int(12)
57: }
58: array(1) {
59: [-7]=>
60: int(-7)
61: }
62: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>