summaryrefslogtreecommitdiff
path: root/ext/standard/tests/array/array_diff_key2.phpt
blob: b7ef7f31cac4fd8e52de3b50675e94485ef86cfa (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
--TEST--
basic array_diff_key test
--FILE--
<?php
$array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red", "");
$array2 = array("a" => "green", "yellow", "red", TRUE);
$array3 = array("red", "a"=>"brown", "");
$result[] = array_diff_key($array1, $array2);
$result[] = array_diff_key($array1, $array3);
$result[] = array_diff_key($array2, $array3);
$result[] = array_diff_key($array1, $array2, $array3);

var_dump($result);

?>
--EXPECT--
array(4) {
  [0]=>
  array(2) {
    ["b"]=>
    string(5) "brown"
    ["c"]=>
    string(4) "blue"
  }
  [1]=>
  array(2) {
    ["b"]=>
    string(5) "brown"
    ["c"]=>
    string(4) "blue"
  }
  [2]=>
  array(1) {
    [2]=>
    bool(true)
  }
  [3]=>
  array(2) {
    ["b"]=>
    string(5) "brown"
    ["c"]=>
    string(4) "blue"
  }
}