Have testSorting return the faulty key in the error msg

PHP sure aint Python :'( This works, probably overkill, couldn’t see anything in PHP docs for a good function to use.