title: Modify array values in foreach loop
body: <p>I was wondering if it is possible to edit the current object that's being handled within a <code>foreach</code> loop</p>
  
  <p>I'm working with an array of objects <code>$questions</code> and I want to go through and look for the answers associated with that question object in my db. So for each question go fetch the answer objects and update the current <code>$question</code> <strong>inside</strong> my <code>foreach</code> loop so I can output/process elsewhere.</p>
  
  <pre><code>foreach($questions as $question){
      $question['answers'] = $answers_model-&gt;get_answers_by_question_id($question['question_id']);
  }
  </code></pre>