Pass-by-reference the third parameter in PHP array_walk, without a warning
<p>Is there a way to make this code work without a Warning?</p>

<pre><code>function myFunction($value, $key, &amp;$array)
{
     if (strlen($value)&lt;=2) $array[] = $key.$value;
}
$a = array("aa", "bbb", "cc", "dd");
$resultA = array();
array_walk($a, 'myFunction', &amp;$resultA);
// now '$resultA' should contain: Array([0] =&gt; aa0 [1] =&gt; cc2 [2] =&gt; dd3)
</code></pre>

<p>It works, but it always throws this warning message:</p>

<blockquote>
  <p>Warning: Call-time pass-by-reference
  has been deprecated in
  path_to\index.php
  on line 7</p>
</blockquote>

<p>I thought that removing the ampersand from the call should be enough to make the warning disappear, and it is, but, strangely the "array_walk" doesn't acomulate the third parameter if I just specify the &amp; in "myFunction". <strong>To make it work there has to be an &amp; in the call too</strong>, but then it will trigger the warning.</p>

<p>Further, as a temorary workaround I have tried to set the php.ini var "allow_call_time_pass_reference" to true, but I still get the warning...</p>

<p>I'm wondering that may be there's better/preferred method to apply user-defined functions to each element of an array WITH a passed-by-reference parameter.</p>
