There's almost certainly a better (more efficient) way, but this should work:
$places = Array(
array("id"=>"object1", "rounds"=>5, "x"=>520),
array("id"=>"object2", "rounds"=>10, "x"=>140),
array("id"=>"object3", "rounds"=>10, "x"=>10)
);
$placesGroupedByRealX = Array();
foreach( $places as $place ) {
/**
* rounds = 750x
*/
$realX = ((int)$place['rounds'] x 750) + $place['x'];
/**
* Make each $placesGroupedByRealX an array for the value of
* $place["rounds"] if it isn't already.
*/
$placesGroupedByRealX[ $realX ] = ( isset($placesGroupedByRealX[ $realX ]))
? $placesGroupedByRealX[ $realX ]
: Array();
// We store into the array to prevent over-writes, even though
// it feels clunky
$placesGroupedByRealX[ $realX ][] = $place;
}
/**
* Order them by realX descending
*/
natsort($placesGroupedByRealX);
$placesGroupedByRealX = array_reverse($placesGroupedByRealX, true);
$results = Array();
/**
* Iterate over the nested arrays and add them a resultset
*/
foreach ( $placesGroupedByRealX as $score => $place ) {
$results[] = $place;
}
//results should now be your places ordered highest to lowest for x and rounds.
$results;