3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $array = array( '13-2014' => 'a', '14-2014' => 'a', '6-2014' => 'a', ); ksort($array, SORT_LOCALE_STRING); print_r($array);
Output for 4.4.0 - 4.4.9, 5.0.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [13-2014] => a [14-2014] => a [6-2014] => a )
Output for 4.3.0 - 4.3.11, 5.0.0 - 5.0.1
Notice: Use of undefined constant SORT_LOCALE_STRING - assumed 'SORT_LOCALE_STRING' in /in/Hmcen on line 7 Warning: ksort() expects parameter 2 to be long, string given in /in/Hmcen on line 7 Array ( [13-2014] => a [14-2014] => a [6-2014] => a )