3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arrDates = array( "12/25/2009","01/10/2008","02/12/2000","03/17/1948", "03/06/1948","11/25/1972","10/23/2009","01/14/2008", "02/22/2000","03/27/1948","03/16/1948","11/24/1972", "11/13/2009","11/10/2008","12/12/2000","05/17/1948", "05/06/1948","10/25/1972","09/23/2009","02/14/2008", "03/22/2000","04/27/1948","04/16/1948","08/24/1972" ); /** * better_cmp() * @param int $a * @param int $b * date comparison callback **/ function better_cmp($a,$b){ list($a,$b) = [strtotime($a), strtotime($b)]; return ($a <=> $b); } usort($arrDates,"better_cmp"); print_r($arrDates);

preferences:
56.8 ms | 402 KiB | 5 Q