Make php deterministic sorting work for party sorting too