3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $arr = array('11-01-2012', '01-01-2014', '01-01-2015', '09-02-2013', '01-01-2013'); function date_sort($a, $b) { return strtotime($a) - strtotime($b); } rsort($arr, "date_sort"); print_r($arr);
based on mZPSj
Output for 7.3.0alpha1 - 7.3.0beta1
Warning: rsort() expects parameter 2 to be int, string given in /in/JXPLD on line 6 Array ( [0] => 11-01-2012 [1] => 01-01-2014 [2] => 01-01-2015 [3] => 09-02-2013 [4] => 01-01-2013 )
Output for hhvm-3.18.5 - 3.21.3, 7.0.0 - 7.2.6
Warning: rsort() expects parameter 2 to be integer, string given in /in/JXPLD on line 6 Array ( [0] => 11-01-2012 [1] => 01-01-2014 [2] => 01-01-2015 [3] => 09-02-2013 [4] => 01-01-2013 )
Output for hhvm-3.22.0
Warning: rsort() expects parameter 2 to be integer, string given in /in/JXPLD on line -1 Array ( [0] => 11-01-2012 [1] => 01-01-2014 [2] => 01-01-2015 [3] => 09-02-2013 [4] => 01-01-2013 )
Output for 5.6.30
Warning: rsort() expects parameter 2 to be long, string given in /in/JXPLD on line 6 Array ( [0] => 11-01-2012 [1] => 01-01-2014 [2] => 01-01-2015 [3] => 09-02-2013 [4] => 01-01-2013 )