PHP shuffle not working like expected on my nested array
<p>I have a nested array of arrays, and I want to shuffle the inner arrays. My code looks like this (simplified):</p>

<pre><code>$a = array(array('banana', 'peach'), array('ding', 'dong'), array('oh snow'));
foreach ($a as &amp;$arr) {
    shuffle($arr);
}
var_dump($a);
</code></pre>

<p>The var_dump outputs this:</p>

<pre><code>array(3) { [0]=&gt; array(2) { [0]=&gt; string(5) "peach" [1]=&gt; string(6) "banana" } [1]=&gt; array(2) { [0]=&gt; string(4) "ding" [1]=&gt; string(4) "dong" } [2]=&gt; &amp;array(1) { [0]=&gt; string(7) "oh snow" } } 
</code></pre>

<p>As you can see in the output, the first two subarrays work, but the third subarray is linked by reference in the output...</p>

<p>In my full app, this last array-link causes problems, but rather than working around the issue, I want to fix this shuffle thing...</p>

<p>Cheers!</p>
