title: PHP: Strange effect when passing array into MongoCollection#insert()
body: <p>In PHP arrays are assigned by value. Hence, when I do something like this:</p>
  
  <pre><code>$a = ['a' =&gt; 'ape'];
  $b = $a;
  
  $a['b'] = 'banana';
  </code></pre>
  
  <p>Only $a will have the key 'b', but $b won't be modified. That also applies when either array is assigned by reference into a function and that function modifies the array.</p>
  
  <p>However, there's a strange thing happening if I try to insert a document using the PECL MongoDB extension. In the following unit test the second assertion fails for me:</p>
  
  <pre><code>public function testUpdateGeneratesId()
  {
    $doc1 = ['author' =&gt; 'j.henning', 'title' =&gt; 'My Blog Entry'];
    $doc2 = $doc1;
  
    $this-&gt;blog-&gt;insert($doc1, ['w' =&gt; 1]);
  
    $this-&gt;assertNotNull($doc1['_id']);
    $this-&gt;assertArrayNotHasKey('_id', $doc2);
  }
  </code></pre>
  
  <p>The #insert() generates the key '_id' on the inserted document, but I would expect the key only to be added to $doc1. However, it's created on both arrays.</p>
  
  <p>Can anybody reproduce this behavior or give any explanation for it? </p>