3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = array( 18 => 30, 10 => 10, 17 => 30, ); asort($array, SORT_NATURAL); var_dump($array);
based on qVv7s
Output for 7.0.0 - 7.2.0
array(3) { [10]=> int(10) [18]=> int(30) [17]=> int(30) }
Output for 5.4.10 - 5.6.28
array(3) { [10]=> int(10) [17]=> int(30) [18]=> int(30) }
Output for 5.3.20 - 5.3.29
Notice: Use of undefined constant SORT_NATURAL - assumed 'SORT_NATURAL' in /in/PXaEt on line 10 Warning: asort() expects parameter 2 to be long, string given in /in/PXaEt on line 10 array(3) { [18]=> int(30) [10]=> int(10) [17]=> int(30) }