title: How to push additional fields into an Array in Php ?
body: <p>Hello I'm looking to find the best practice to push an additional field into an Array with php.
  I've tried both array_push and its equivalent $array[] = $var; but its not what I'm looking to get.</p>
  
  <p>I have a loop like so:</p>
  
  <pre><code>    foreach($lakesNearby as $lakes){
          $dist = $this-&gt;getDistance($lat, $lng, $lakes['latitude'], $lakes['longitude'], $unit);
          $lakes['distance'] = $dist;
          $lakesReturned[] = $lakes;
      }
  </code></pre>
  
  <p>But I'm sure there is a better way to combine the two last lines and push it into $lakesNearby ?</p>