Annotation of embedaddon/php/ext/standard/tests/array/array_diff_variation10.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test array_diff() function : usage variations - binary safe checking
3: --FILE--
4: <?php
5: /* Prototype : array array_diff(array $arr1, array $arr2 [, array ...])
6: * Description: Returns the entries of $arr1 that have values which are
7: * not present in any of the others arguments.
8: * Source code: ext/standard/array.c
9: */
10:
11: /*
12: * Test behaviour of array_diff() function with binary input
13: */
14:
15: echo "*** Testing array_diff() : usage variations ***\n";
16:
17:
18: $array1 = array( b"1",
19: b"hello",
20: "world",
21: "str1" => "hello",
22: "str2" => "world");
23:
24: $array2 = array( b"1" => 'hello',
25: b"world",
26: "hello",
27: 'test');
28:
29: var_dump(array_diff($array1, $array2));
30: var_dump(array_diff($array2, $array1));
31:
32: echo "Done";
33: ?>
34: --EXPECTF--
35: *** Testing array_diff() : usage variations ***
36: array(1) {
37: [0]=>
38: string(1) "1"
39: }
40: array(1) {
41: [4]=>
42: string(4) "test"
43: }
44: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>