1--TEST--
2Sort with SORT_LOCALE_STRING
3--SKIPIF--
4<?php
5if (setlocale(LC_ALL, 'invalid') === 'invalid') { die('skip setlocale() is broken /w musl'); }
6if (substr(PHP_OS, 0, 3) == 'WIN') {
7  die("skip Unix locale name only, not available on windows (and crashes with VC6)\n");
8}
9if (false == setlocale(LC_CTYPE, "fr_FR.ISO8859-1", "fr_FR")) {
10  die("skip setlocale() failed\n");
11}
12?>
13--FILE--
14<?php
15setlocale(LC_ALL, 'fr_FR.ISO8859-1', 'fr_FR');
16$table = array("AB" => "Alberta",
17"BC" => "Colombie-Britannique",
18"MB" => "Manitoba",
19"NB" => "Nouveau-Brunswick",
20"NL" => "Terre-Neuve-et-Labrador",
21"NS" => "Nouvelle-�cosse",
22"ON" => "Ontario",
23"PE" => "�le-du-Prince-�douard",
24"QC" => "Qu�bec",
25"SK" => "Saskatchewan",
26"NT" => "Territoires du Nord-Ouest",
27"NU" => "Nunavut",
28"YT" => "Territoire du Yukon");
29asort($table, SORT_LOCALE_STRING);
30var_dump($table);
31?>
32--EXPECT--
33array(13) {
34  ["AB"]=>
35  string(7) "Alberta"
36  ["BC"]=>
37  string(20) "Colombie-Britannique"
38  ["PE"]=>
39  string(21) "�le-du-Prince-�douard"
40  ["MB"]=>
41  string(8) "Manitoba"
42  ["NB"]=>
43  string(17) "Nouveau-Brunswick"
44  ["NS"]=>
45  string(15) "Nouvelle-�cosse"
46  ["NU"]=>
47  string(7) "Nunavut"
48  ["ON"]=>
49  string(7) "Ontario"
50  ["QC"]=>
51  string(6) "Qu�bec"
52  ["SK"]=>
53  string(12) "Saskatchewan"
54  ["NL"]=>
55  string(23) "Terre-Neuve-et-Labrador"
56  ["YT"]=>
57  string(19) "Territoire du Yukon"
58  ["NT"]=>
59  string(25) "Territoires du Nord-Ouest"
60}
61