How to avoid call-time pass-by-reference deprecated error in PHP?
<p>I'm trying to <strong>reduce the warnings</strong> that are sent to my apache server log.</p>

<p>One warning is:</p>

<blockquote>
  <p>Call-time pass-by-reference has been deprecated.</p>
</blockquote>

<p>It is <strong>hard for me to imagine</strong> why this was deprecated since it is such a useful programming feature, basically I do this:</p>

<pre><code>public function takeScriptsWithMarker(&amp;$lines, $marker) {

    ...
}
</code></pre>

<p>and I call this function repeatedly getting results back from it and processing them but also letting the array $lines build up by being sent into this method repeatedly. </p>

<ol>
<li>To reprogram this would be extensive.</li>
<li>I don't want to just "turn off warnings" since I want to see other warnings.</li>
</ol>

<p>So, as call-by-reference is deprecated, <strong>what is the "accepted way" to attain the functionality</strong> of this pattern: namely of sending an array of strings into a method, have them be changed by the method, then continuing to use that array?</p>
