What is an elegant way to sort objects in PHP? I would love to accomplish something similar to this.
$sortedObjectArary = sort($unsortedObjectArray, $Object-
For that compare function, you can just do:
function cmp( $a, $b ) { return $b->weight - $a->weight; }