3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dates = array('1-2018','5-2019','10-2018','5-2020','9-1978','6-2001'); usort($dates, function($a,$b){ return strtotime('1-'.$a) <=>strtotime('1-'.$b);}); var_export($dates); echo "\n"; echo "Min: ".reset($dates)."\n"; echo "Max: ".end($dates)."\n";

preferences:
57.64 ms | 408 KiB | 5 Q