Using usort for object sorting
<p>I am trying to sort an object array by distance using usort. Here is my sort function:</p>

<pre><code>private function sortDistance ($first, $next)
{
    $d1 = $this-&gt;searchDistance[$first-&gt;zip];
    $d2 = $this-&gt;searchDistance[$next-&gt;zip];

    if ($d1 == $d2) {
        return 0;
    }
    return ($d1 &gt; $d2) ? +1 : -1;
}
</code></pre>

<p>Here is where I am calling usort:</p>

<pre><code>return usort($searchResults-&gt;limit('5', $start)-&gt;get()-&gt;result(), array("Search", "sortDistance"));
</code></pre>

<p>For some reason, when I print_r the returned result, its only printing 1. Am I doing something wrong?</p>

<p>Thanks</p>
