3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $years = array( 1=>"2000", 2=>"2001", 3=>"2002", 4=>"2003", 5=>"2004", 6=>"2005", 7=>"2006", 8=>"2007", 9=>"2008", 10=>"2009", 11=>"2010", 12=>"2011", 13=>"2012", 14=>"2013", ); var_dump($years); var_dump(rsort($years)); var_dump(krsort($years)); ?>
Output for 4.3.0 - 7.1.0
array(14) { [1]=> string(4) "2000" [2]=> string(4) "2001" [3]=> string(4) "2002" [4]=> string(4) "2003" [5]=> string(4) "2004" [6]=> string(4) "2005" [7]=> string(4) "2006" [8]=> string(4) "2007" [9]=> string(4) "2008" [10]=> string(4) "2009" [11]=> string(4) "2010" [12]=> string(4) "2011" [13]=> string(4) "2012" [14]=> string(4) "2013" } bool(true) bool(true)