title: Best practice: returning multiple values
body: <p>What would be recommended from a pure coding best practices perspective to adopt as a standard for medium-large developer teams?</p>
  
  <p><strong>Return a sequential array:</strong></p>
  
  <pre><code>function get_results($filter) {
      $query = "SELECT SQL_CALC_FOUND_ROWS, * FROM ...";
  
      $results = ...
      $total = ...
  
      return array($results, $total);
  }
  </code></pre>
  
  <p><strong>Return an associative array:</strong></p>
  
  <pre><code>function get_results($filter) {
      $query = "SELECT SQL_CALC_FOUND_ROWS, * FROM ...";
  
      $results = ...
      $total = ...
  
      return array(
          'resuts' =&gt; $results, 
          'total' =&gt; $total
      );
  }
  </code></pre>
  
  <p><strong>Return single result and assign the second by reference (?!):</strong></p>
  
  <pre><code>function get_results($filter, &amp;$count = null) {
      $query = "SELECT SQL_CALC_FOUND_ROWS, * FROM ...";
  
      $results = ...
      $total = ...
  
      $count = $total;
      return $results;
  }
  </code></pre>
  
  <p><strong><em>Feel free to suggest any other approach.</em></strong></p>