is it better t use &$ with large strings to save memory?
<p>So I was wondering, in effort to save some precious memory allocation on a pretty busy server.</p>

<p>if I have roughly 1-5mb strings getting tossed around my program whilst it compiles the final output, is it better to explictly pass them around by reference? Would that save memory or not?</p>

<p>So basically the question is: Memory wise what's better, A or B And is it worth the effort?</p>

<p>A:</p>

<pre><code>function something($whoa) {
  $whoa .= 'bar';
  return $whoa;
}
$baz = 'foo';
$baz = something($baz);
echo $baz;
</code></pre>

<p>B:</p>

<pre><code>function something(&amp;$whoa) {
  $whoa .= 'bar';
}
$baz = 'foo';
something($baz);
echo $baz;
</code></pre>