summaryrefslogtreecommitdiff
path: root/ext/standard/tests/array/array_diff_ukey_variation5.phpt
blob: c41147d83986305029f827d6e505fcd252b0301f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--TEST--
Test array_diff_ukey() function : usage variation - Passing multi-dimensional array
--FILE--
<?php
echo "*** Testing array_diff_ukey() : usage variation ***\n";

// Initialise function arguments not being substituted (if any)
$array1 = array(

      'first' => array('blue' => 1, 'red' => 2),

      'second' => array('yellow' => 7),

      'third' => array(0 => 'zero'),
);

$array2 = array (

      'first' => array('blue' => 1, 'red' => 2,),

      'second' => array('cyan' => 8),

      'fourth' => array(2 => 'two'),
);

echo "\n-- Testing array_diff_ukey() function with multi dimensional array --\n";
var_dump( array_diff_ukey($array1, $array2, 'strcasecmp') );
var_dump( array_diff_ukey($array2, $array1, 'strcasecmp') );
?>
--EXPECT--
*** Testing array_diff_ukey() : usage variation ***

-- Testing array_diff_ukey() function with multi dimensional array --
array(1) {
  ["third"]=>
  array(1) {
    [0]=>
    string(4) "zero"
  }
}
array(1) {
  ["fourth"]=>
  array(1) {
    [2]=>
    string(3) "two"
  }
}