3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php header('Content-Type: text/html; charset=utf-8'); echo "<pre>"; setlocale(LC_ALL, 'cs_CZ.UTF-8', 'Czech'); echo "Nastaveny locale: ". setlocale(LC_ALL, 0) . "\n"; $countries = array( 'Bulharsko', 'Česko', 'Polsko', 'Čína' ); sort($countries, SORT_LOCALE_STRING); print_r($countries);
Output for 4.4.0 - 4.4.9, 5.0.2 - 7.1.0
<pre>Nastaveny locale: C Array ( [0] => Bulharsko [1] => Polsko [2] => Česko [3] => Čína )
Output for 4.3.0 - 4.3.11, 5.0.0 - 5.0.1
<pre>Nastaveny locale: C Notice: Use of undefined constant SORT_LOCALE_STRING - assumed 'SORT_LOCALE_STRING' in /in/1AUrV on line 13 Warning: sort() expects parameter 2 to be long, string given in /in/1AUrV on line 13 Array ( [0] => Bulharsko [1] => Česko [2] => Polsko [3] => Čína )