Annotation of embedaddon/php/ext/standard/tests/array/array_multisort_variation4.phpt, revision 1.1.1.2
1.1 misho 1: --TEST--
2: Test array_multisort() function : usage variation - testing with multiple array arguments
3: --FILE--
4: <?php
1.1.1.2 ! misho 5: /* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]], ...])
1.1 misho 6: * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL
7: * Source code: ext/standard/array.c
8: * Alias to functions:
9: */
10:
11: echo "*** Testing array_multisort() : Testing with multiple array arguments ***\n";
12:
13: $arr1 = array (4,3,3,3);
14: $arr2 = array (9,3,2,2);
15: $arr3 = array (9,9,2,1);
16:
17: var_dump(array_multisort($arr1, $arr2, $arr3));
18:
19: var_dump($arr1);
20: var_dump($arr2);
21: var_dump($arr3);
22:
23: ?>
24: ===DONE===
25: --EXPECTF--
26: *** Testing array_multisort() : Testing with multiple array arguments ***
27: bool(true)
28: array(4) {
29: [0]=>
30: int(3)
31: [1]=>
32: int(3)
33: [2]=>
34: int(3)
35: [3]=>
36: int(4)
37: }
38: array(4) {
39: [0]=>
40: int(2)
41: [1]=>
42: int(2)
43: [2]=>
44: int(3)
45: [3]=>
46: int(9)
47: }
48: array(4) {
49: [0]=>
50: int(1)
51: [1]=>
52: int(2)
53: [2]=>
54: int(9)
55: [3]=>
56: int(9)
57: }
58: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>