3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array("D"=>"dog","a"=>"cat","A"=>"moose","d"=>"mouse"); ksort($arr, $sort_flags=SORT_FLAG_CASE); var_dump($arr);
Output for 5.4.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
array(4) { ["A"]=> string(5) "moose" ["D"]=> string(3) "dog" ["a"]=> string(3) "cat" ["d"]=> string(5) "mouse" }
Output for 4.3.0 - 5.3.29
Notice: Use of undefined constant SORT_FLAG_CASE - assumed 'SORT_FLAG_CASE' in /in/kV21S on line 6 Warning: ksort() expects parameter 2 to be long, string given in /in/kV21S on line 6 array(4) { ["D"]=> string(3) "dog" ["a"]=> string(3) "cat" ["A"]=> string(5) "moose" ["d"]=> string(5) "mouse" }