Annotation of embedaddon/php/ext/standard/tests/array/array_multisort_variation6.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test array_multisort() function : usage variation - testing with multiple array arguments
3: --FILE--
4: <?php
5: /* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING]], ...])
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 all array sort specifiers ***\n";
12:
13: $ar = array( 2, "aa" , "1");
14:
15: array_multisort($ar, SORT_REGULAR, SORT_DESC);
16: var_dump($ar);
17:
18: array_multisort($ar, SORT_STRING, SORT_DESC);
19: var_dump($ar);
20:
21: array_multisort($ar, SORT_NUMERIC, SORT_DESC);
22: var_dump($ar);
23:
24:
25: ?>
26: ===DONE===
27: --EXPECTF--
28: *** Testing array_multisort() : Testing all array sort specifiers ***
29: array(3) {
30: [0]=>
31: int(2)
32: [1]=>
33: string(2) "aa"
34: [2]=>
35: string(1) "1"
36: }
37: array(3) {
38: [0]=>
39: string(2) "aa"
40: [1]=>
41: int(2)
42: [2]=>
43: string(1) "1"
44: }
45: array(3) {
46: [0]=>
47: int(2)
48: [1]=>
49: string(1) "1"
50: [2]=>
51: string(2) "aa"
52: }
53: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>