title: PHP: Array passed by reference to a function?
body: <p>I have this php function that has to perform some processing on a given array:</p>
  
  <pre><code>processArray($arrayToProcess) {
  
    $arrayToProcess['helloStackOverflow'] = TRUE;
  }
  </code></pre>
  
  <p>Later, the code invokes the following:</p>
  
  <pre><code>$niceArray = array('key' =&gt; 'value');
  processArray($niceArray);
  </code></pre>
  
  <p>The key 'helloStackOverflow' isn't available outside the processArray function. I tried calling the following:</p>
  
  <pre><code>processArray(&amp;$niceArray);
  </code></pre>
  
  <p>Using "&amp;" helps, however it raises some warning:</p>
  
  <blockquote>
    <p>Deprecated function: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of populateForm_withTextfields()</p>
  </blockquote>
  
  <p>Tried the &amp; in there, but that just stops the code.</p>
  
  <p>How should I do this?</p>