3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = array("Sophia"=>"31","Jacob"=>"41","William"=>"39","Ramesh"=>"40"); sort($a); print_r($a); echo "\n\n"; asort($a); print_r($a); echo "\n\n"; rsort($a); print_r($a); echo "\n\n"; arsort($a); print_r($a); echo "\n\n"; ?>
based on 2hjsN
Output for 4.3.0 - 7.1.0
Array ( [0] => 31 [1] => 39 [2] => 40 [3] => 41 ) Array ( [0] => 31 [1] => 39 [2] => 40 [3] => 41 ) Array ( [0] => 41 [1] => 40 [2] => 39 [3] => 31 ) Array ( [0] => 41 [1] => 40 [2] => 39 [3] => 31 )