Annotation of embedaddon/php/ext/standard/tests/strings/bug47481.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Bug #47481 (natcasesort() does not sort extended ASCII characters correctly)
3: --FILE--
4: <?php
5: /* Prototype : bool natcasesort(array &$array_arg)
6: * Description: Sort an array using case-insensitive natural sort
7: * Source code: ext/standard/array.c
8: */
9:
10: /*
11: * Test natcasesort() with extended ASCII characters
12: */
13:
14: $array = array ('Süden', 'spielen','Sonne','Wind','Regen','Meer');
15: echo "\n-- Before sorting: --\n";
16: var_dump($array);
17:
18: echo "\n-- After Sorting: --\n";
19: var_dump(natcasesort($array));
20: var_dump($array);
21:
22: echo "Done";
23: ?>
24: --EXPECTF--
25: -- Before sorting: --
26: array(6) {
27: [0]=>
28: %string|unicode%(6) "Süden"
29: [1]=>
30: %string|unicode%(7) "spielen"
31: [2]=>
32: %string|unicode%(5) "Sonne"
33: [3]=>
34: %string|unicode%(4) "Wind"
35: [4]=>
36: %string|unicode%(5) "Regen"
37: [5]=>
38: %string|unicode%(4) "Meer"
39: }
40:
41: -- After Sorting: --
42: bool(true)
43: array(6) {
44: [5]=>
45: %string|unicode%(4) "Meer"
46: [4]=>
47: %string|unicode%(5) "Regen"
48: [2]=>
49: %string|unicode%(5) "Sonne"
50: [1]=>
51: %string|unicode%(7) "spielen"
52: [0]=>
53: %string|unicode%(6) "Süden"
54: [3]=>
55: %string|unicode%(4) "Wind"
56: }
57: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>