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_NATURAL); print_r($array);
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [6-2014] => a [13-2014] => a [14-2014] => a )
Output for 4.3.0 - 5.3.29
Notice: Use of undefined constant SORT_NATURAL - assumed 'SORT_NATURAL' in /in/VInAt on line 7 Warning: ksort() expects parameter 2 to be long, string given in /in/VInAt on line 7 Array ( [13-2014] => a [14-2014] => a [6-2014] => a )