3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array(-INF, 7, INF, NAN, array(), 3, (object)array()); sort($arr); var_dump($arr);
based on WrMg9
Output for 7.1.10 - 7.2.0
array(7) { [0]=> float(NAN) [1]=> float(-INF) [2]=> int(3) [3]=> int(7) [4]=> float(INF) [5]=> array(0) { } [6]=> object(stdClass)#1 (0) { } }
Output for 7.0.0 - 7.1.7
array(7) { [0]=> float(-INF) [1]=> int(7) [2]=> float(INF) [3]=> float(NAN) [4]=> int(3) [5]=> array(0) { } [6]=> object(stdClass)#1 (0) { } }
Output for 5.3.21 - 5.6.28
Notice: Object of class stdClass could not be converted to double in /in/LWKr7 on line 4 Notice: Object of class stdClass could not be converted to double in /in/LWKr7 on line 4 Notice: Object of class stdClass could not be converted to int in /in/LWKr7 on line 4 array(7) { [0]=> float(-INF) [1]=> object(stdClass)#1 (0) { } [2]=> int(3) [3]=> float(NAN) [4]=> int(7) [5]=> float(INF) [6]=> array(0) { } }