title: Sort array by object property in PHP?
body: <p>If I have an object as such:</p>
  
  <pre><code>class Person {
    var $age;
    function __construct($age) {
      $this-&gt;age = $age;
    }
  }
  </code></pre>
  
  <p>and I have any array of <code>Person</code>s</p>
  
  <pre><code>$person1 = new Person(14);
  $person2 = new Person(5);
  $people = array($person1, $person2);
  </code></pre>
  
  <p>Is there an easy way to sort the <code>$people</code> array by the <code>Person-&gt;age</code> property?</p>