3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array("D"=>"dog","a"=>"cat","A"=>"moose","d"=>"mouse"); ksort($arr, SORT_FLAG_CASE); var_dump($arr);
Output for 5.4.0 - 7.2.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/86aCS on line 6 Warning: ksort() expects parameter 2 to be long, string given in /in/86aCS on line 6 array(4) { ["D"]=> string(3) "dog" ["a"]=> string(3) "cat" ["A"]=> string(5) "moose" ["d"]=> string(5) "mouse" }