array_multisort(array_map('filemtime', ($files = glob("*.json"))), SORT_DESC, $files);
This is the most efficient method to sort 45k json files I have found so far. Works great, except in my case the files are constantly being changed by a game server so if a file gets deleted during this sort execution I get a error
String: filemtime(): stat failed for blah.json
Can I handle this with a try and catch exception? I am not having any luck searching for a solution.