<?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-objectid.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'mongodb-bson-objectid.jsonserialize.php',
    1 => 'MongoDB\\BSON\\ObjectId::jsonSerialize',
    2 => 'Returns a representation that can be converted to JSON',
  ),
  'up' => 
  array (
    0 => 'class.mongodb-bson-objectid.php',
    1 => 'MongoDB\\BSON\\ObjectId',
  ),
  'prev' => 
  array (
    0 => 'mongodb-bson-objectid.gettimestamp.php',
    1 => 'MongoDB\\BSON\\ObjectId::getTimestamp',
  ),
  'next' => 
  array (
    0 => 'mongodb-bson-objectid.tostring.php',
    1 => 'MongoDB\\BSON\\ObjectId::__toString',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/mongodb/bson/objectid/jsonserialize.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="mongodb-bson-objectid.jsonserialize" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">MongoDB\BSON\ObjectId::jsonSerialize</h1>
  <p class="verinfo">(mongodb &gt;=1.2.0)</p><p class="refpurpose"><span class="refname">MongoDB\BSON\ObjectId::jsonSerialize</span> &mdash; <span class="dc-title">Returns a representation that can be converted to JSON</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-mongodb-bson-objectid.jsonserialize-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">final</span> <span class="modifier">public</span> <span class="methodname"><strong>MongoDB\BSON\ObjectId::jsonSerialize</strong></span>(): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>

 </div>


 <div class="refsect1 parameters" id="refsect1-mongodb-bson-objectid.jsonserialize-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">This function has no parameters.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-mongodb-bson-objectid.jsonserialize-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="simpara">
   Returns data which can be serialized by <span class="function"><a href="function.json-encode.php" class="function">json_encode()</a></span> to
   produce an extended JSON representation of the
   <span class="classname"><a href="class.mongodb-bson-objectid.php" class="classname">MongoDB\BSON\ObjectId</a></span>.
  </p>
  
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <span class="simpara">
    The output is consistent with the <span class="function"><a href="function.mongodb.bson-tojson.php" class="function">MongoDB\BSON\toJSON()</a></span>
    function, which uses the driver-specific legacy extended JSON format. This
    does not necessarily match the
    <a href="https://github.com/mongodb/specifications/blob/master/source/extended-json/extended-json.md#relaxed-extended-json-example" class="link external">&raquo;&nbsp;relaxed</a>
    or <a href="https://github.com/mongodb/specifications/blob/master/source/extended-json/extended-json.md#canonical-extended-json-example" class="link external">&raquo;&nbsp;canonical</a>
    extended JSON representations used by
    <span class="function"><a href="function.mongodb.bson-torelaxedextendedjson.php" class="function">MongoDB\BSON\toRelaxedExtendedJSON()</a></span> and
    <span class="function"><a href="function.mongodb.bson-tocanonicalextendedjson.php" class="function">MongoDB\BSON\toCanonicalExtendedJSON()</a></span>, respectively.
   </span>
  </p></blockquote>

 </div>


 <div class="refsect1 errors" id="refsect1-mongodb-bson-objectid.jsonserialize-errors">
  <h3 class="title">Errors/Exceptions</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> on argument parsing errors.</li>
  </ul>
 </div>


 <div class="refsect1 seealso" id="refsect1-mongodb-bson-objectid.jsonserialize-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="jsonserializable.jsonserialize.php" class="methodname" rel="rdfs-seeAlso">JsonSerializable::jsonSerialize()</a> - Specify data which should be serialized to JSON</span></li>
   <li><span class="function"><a href="function.json-encode.php" class="function" rel="rdfs-seeAlso">json_encode()</a> - Returns the JSON representation of a value</span></li>
   <li><span class="function"><a href="function.mongodb.bson-tocanonicalextendedjson.php" class="function" rel="rdfs-seeAlso">MongoDB\BSON\toCanonicalExtendedJSON()</a> - Returns the Canonical Extended JSON representation of a BSON value</span></li>
   <li><span class="function"><a href="function.mongodb.bson-torelaxedextendedjson.php" class="function" rel="rdfs-seeAlso">MongoDB\BSON\toRelaxedExtendedJSON()</a> - Returns the Relaxed Extended JSON representation of a BSON value</span></li>
   <li><a href="https://www.mongodb.com/docs/manual/reference/mongodb-extended-json/" class="link external">&raquo;&nbsp;MongoDB Extended JSON</a></li>
  </ul>
 </div>


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