title: Unable to get mongodb _id value in php
body: <p>I tried a lot of tricks to get the value of mongodb _id, but all of them result in error. I tried these:</p>
  
  <pre><code>$new_id = new MongoId();
  print_r($new_id['_id']); // -&gt; Internal Server Error
  echo $new_id['_id']-&gt;{'$id'}; // -&gt; Internal Server Error
  print_r($new_id); // no error, but useless
  </code></pre>
  
  <p>So, I wonder how to do it right</p>