<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.mongodb-bson-document.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ja',
  ),
  'this' => 
  array (
    0 => 'mongodb-bson-document.tophp.php',
    1 => 'MongoDB\\BSON\\Document::toPHP',
    2 => 'Returns the PHP representation of the BSON document',
  ),
  'up' => 
  array (
    0 => 'class.mongodb-bson-document.php',
    1 => 'MongoDB\\BSON\\Document',
  ),
  'prev' => 
  array (
    0 => 'mongodb-bson-document.tocanonicalextendedjson.php',
    1 => 'MongoDB\\BSON\\Document::toCanonicalExtendedJSON',
  ),
  'next' => 
  array (
    0 => 'mongodb-bson-document.torelaxedextendedjson.php',
    1 => 'MongoDB\\BSON\\Document::toRelaxedExtendedJSON',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mongodb/bson/document/tophp.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="mongodb-bson-document.tophp" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoDB\BSON\Document::toPHP</h1>
  <p class="verinfo">(mongodb &gt;=1.16.0)</p><p class="refpurpose"><span class="refname">MongoDB\BSON\Document::toPHP</span> &mdash; <span class="dc-title">Returns the PHP representation of the BSON document</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongodb-bson-document.tophp-description">
  <h3 class="title">説明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><strong>MongoDB\BSON\Document::toPHP</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.array.php" class="type array">array</a></span></span> <code class="parameter">$typeMap</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.object.php" class="type object">object</a></span></span></div>

  <p class="simpara">
   Unserializes the BSON document to its PHP representation. The
   <code class="parameter">typeMap</code> paramater may be used to control the PHP types
   used for converting BSON arrays and documents (both root and embedded).
  </p>
  
   <div class="warning"><strong class="warning">警告</strong>
    <p class="simpara">
     BSON documents can technically contain duplicate keys because documents are
     stored as a list of key-value pairs; however, applications should refrain
     from generating documents with duplicate keys as server and driver behavior
     may be undefined. Since PHP objects and arrays cannot have duplicate keys,
     data could also be lost when decoding a BSON document with duplicate keys.
    </p>
   </div>

 </div>


 <div class="refsect1 parameters" id="refsect1-mongodb-bson-document.tophp-parameters">
  <h3 class="title">パラメータ</h3>
  <dl>
   
   
    <dt><code class="parameter">typeMap</code> (<span class="type"><a href="language.types.array.php" class="type array">array</a></span>)</dt>
    <dd>
     <p class="para">
      <a href="mongodb.persistence.php#mongodb.persistence.typemaps" class="link">Type map configuration</a>.
     </p>
    </dd>
   

  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mongodb-bson-document.tophp-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="simpara">
   The decoded PHP value.
  </p>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <span class="simpara">
    When encountering a value encoded as 64-bit integer in the BSON document,
    the return value of this method will be a
    <span class="classname"><a href="class.mongodb-bson-int64.php" class="classname">MongoDB\BSON\Int64</a></span> instance.
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 errors" id="refsect1-mongodb-bson-document.tophp-errors">
  <h3 class="title">エラー / 例外</h3>
  <ul class="simplelist">
   <li>
    Throws
    <span class="classname"><a href="class.mongodb-driver-exception-invalidargumentexception.php" class="classname">MongoDB\Driver\Exception\InvalidArgumentException</a></span> if
    a class in the type map cannot be instantiated or does not implement
    <span class="interfacename"><a href="class.mongodb-bson-unserializable.php" class="interfacename">MongoDB\BSON\Unserializable</a></span>.
   </li>
  </ul>
 </div>


 <div class="refsect1 seealso" id="refsect1-mongodb-bson-document.tophp-seealso">
  <h3 class="title">参考</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.mongodb.bson-tophp.php" class="function" rel="rdfs-seeAlso">MongoDB\BSON\toPHP()</a> - Returns the PHP representation of a BSON value</span></li>
   <li><a href="https://www.mongodb.com/docs/manual/reference/bson-types/" class="link external">&raquo;&nbsp;BSON Types</a></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>