summaryrefslogtreecommitdiff
path: root/ext/standard/tests/array/array_diff_assoc.phpt
blob: 0c615cf012bd74f6841d08669709f9265c92ab17 (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
--TEST--
basic array_diff_assoc 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_assoc($array1, $array2);
$result[] = array_diff_assoc($array1, $array3);
$result[] = array_diff_assoc($array2, $array3);
$result[] = array_diff_assoc($array1, $array2, $array3);
print_r($result)
?>
--EXPECT--
Array
(
    [0] => Array
        (
            [b] => brown
            [c] => blue
            [0] => red
            [1] => 
        )

    [1] => Array
        (
            [a] => green
            [b] => brown
            [c] => blue
        )

    [2] => Array
        (
            [a] => green
            [0] => yellow
            [1] => red
            [2] => 1
        )

    [3] => Array
        (
            [b] => brown
            [c] => blue
        )

)