3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $a = array('a' => 10, 'z' => 10, 'c' => 10, 'b' => 11, 'd' => 10); asort($a, SORT_NUMERIC);var_dump($a);
based on 5UDae
Output for 7.2.0
Warning: Use of undefined constant  SORT_NUMERIC - assumed ' SORT_NUMERIC' (this will throw an Error in a future version of PHP) in /in/fglKq on line 3 Warning: asort() expects parameter 2 to be integer, string given in /in/fglKq on line 3 array(5) { ["a"]=> int(10) ["z"]=> int(10) ["c"]=> int(10) ["b"]=> int(11) ["d"]=> int(10) }
Output for 7.0.0 - 7.1.10
Notice: Use of undefined constant  SORT_NUMERIC - assumed ' SORT_NUMERIC' in /in/fglKq on line 3 Warning: asort() expects parameter 2 to be integer, string given in /in/fglKq on line 3 array(5) { ["a"]=> int(10) ["z"]=> int(10) ["c"]=> int(10) ["b"]=> int(11) ["d"]=> int(10) }
Output for 4.3.0 - 5.6.28
Notice: Use of undefined constant  SORT_NUMERIC - assumed ' SORT_NUMERIC' in /in/fglKq on line 3 Warning: asort() expects parameter 2 to be long, string given in /in/fglKq on line 3 array(5) { ["a"]=> int(10) ["z"]=> int(10) ["c"]=> int(10) ["b"]=> int(11) ["d"]=> int(10) }