If I have an object as such:
class Person { var $age; function __construct($age) { $this->age = $age; } }
and I have any array
You can do it with ouzo goodies:
$result = Arrays::sort(array($person1, $person2), Comparator::compareBy('age'));
http://ouzo.readthedocs.org/en/latest/utils/comparators.html