3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array(10,1,"infinity",3); sort($arr, SORT_NATURAL); var_dump($arr);
based on gFG7r
Output for 5.4.0 - 7.3.0beta1
array(4) { [0]=> int(1) [1]=> int(3) [2]=> int(10) [3]=> string(8) "infinity" }
Output for 4.3.0 - 5.3.29
Notice: Use of undefined constant SORT_NATURAL - assumed 'SORT_NATURAL' in /in/DCLPC on line 3 Warning: sort() expects parameter 2 to be long, string given in /in/DCLPC on line 3 array(4) { [0]=> int(10) [1]=> int(1) [2]=> string(8) "infinity" [3]=> int(3) }