In general when sorting arrays it should be sorted by keys but if they are the same then two elements should be compared by operation.