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_NATURAL || SORT_STRING); var_dump($arr);
Output for 7.0.0 - 7.1.0
array(4) { ["D"]=> string(3) "dog" ["a"]=> string(3) "cat" ["A"]=> string(5) "moose" ["d"]=> string(5) "mouse" }
Output for 5.4.0 - 5.6.28
array(4) { ["d"]=> string(5) "mouse" ["A"]=> string(5) "moose" ["a"]=> string(3) "cat" ["D"]=> string(3) "dog" }
Output for 4.3.0 - 5.3.29
Notice: Use of undefined constant SORT_NATURAL - assumed 'SORT_NATURAL' in /in/HvrR0 on line 6 array(4) { ["d"]=> string(5) "mouse" ["A"]=> string(5) "moose" ["a"]=> string(3) "cat" ["D"]=> string(3) "dog" }