<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.simdjson.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.simdjson-key-value.php',
    1 => 'simdjson_key_value',
    2 => 'Decodes the value of a JSON string located at the requested JSON pointer.',
  ),
  'up' => 
  array (
    0 => 'ref.simdjson.php',
    1 => 'Simdjson Functions',
  ),
  'prev' => 
  array (
    0 => 'function.simdjson-key-exists.php',
    1 => 'simdjson_key_exists',
  ),
  'next' => 
  array (
    0 => 'class.simdjsonexception.php',
    1 => 'SimdJsonException',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/simdjson/functions/simdjson-key-value.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.simdjson-key-value" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">simdjson_key_value</h1>
  <p class="verinfo">(PECL simdjson &gt;= 2.0.0)</p><p class="refpurpose"><span class="refname">simdjson_key_value</span> &mdash; <span class="dc-title">Decodes the value of a JSON string located at the requested JSON pointer.</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.simdjson-key-value-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>simdjson_key_value</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$json</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$key</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> <code class="parameter">$associative</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$depth</code><span class="initializer"> = 512</span></span><br>): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>

  <p class="simpara">
   Decodes and returns the value found at the requested JSON pointer.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.simdjson-key-value-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">json</code></dt>
    <dd>
     <span class="simpara">
      The <code class="parameter">json</code> <span class="type"><a href="language.types.string.php" class="type string">string</a></span> being queried and decoded.
     </span>
      <span class="simpara">
       This function only works with UTF-8 encoded strings.
      </span>
      <span class="simpara">
       This function parses valid inputs which
       <span class="function"><a href="function.json-decode.php" class="function">json_decode()</a></span> can decode,
       provided that they are less than 4 GiB long.
      </span>
    </dd>
   
   
    <dt><code class="parameter">key</code></dt>
    <dd>
     <span class="simpara">
      The JSON pointer <span class="type"><a href="language.types.string.php" class="type string">string</a></span>.
     </span>
    </dd>
   
   
    <dt><code class="parameter">associative</code></dt>
    <dd>
     <span class="simpara">
      When <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>, JSON objects will be returned as
      associative <span class="type"><a href="language.types.array.php" class="type array">array</a></span>s; when <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, JSON objects will be returned as <span class="type"><a href="language.types.object.php" class="type object">object</a></span>s.
     </span>
    </dd>
   
   
    <dt><code class="parameter">depth</code></dt>
    <dd>
     <span class="simpara">
      Maximum nesting depth of the structure being decoded.
      The value must be greater than <code class="literal">0</code>,
      and less than or equal to <code class="literal">2147483647</code>.

      Callers should use reasonably small values,
      because larger depths require more buffer space and will
      increase the recursion depth, unlike the current <span class="function"><a href="function.json-decode.php" class="function">json_decode()</a></span> implementation.
     </span>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.simdjson-key-value-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="simpara">
   Returns the part of the value encoded in <code class="parameter">json</code>
   that <code class="parameter">key</code> refers to in appropriate
   PHP type. Values <code class="literal">true</code>, <code class="literal">false</code> and
   <code class="literal">null</code> are returned as <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> and <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>
   respectively.
  </p>
 </div>

 <div class="refsect1 errors" id="refsect1-function.simdjson-key-value-errors">
  <h3 class="title">Errors/Exceptions</h3>
  <p class="simpara">
   If <code class="parameter">json</code> or <code class="parameter">key</code> is invalid,
   or <code class="parameter">key</code> could not be found within <code class="parameter">json</code>,
   a <span class="classname"><a href="class.simdjsonexception.php" class="classname">SimdJsonException</a></span> is thrown as of PECL simdjson 2.1.0,
   while previously, a <span class="classname"><a href="class.runtimeexception.php" class="classname">RuntimeException</a></span> was thrown.
  </p>
  <p class="simpara">
   If <code class="parameter">depth</code> is outside the allowed range,
   a <span class="classname"><a href="class.simdjsonvalueerror.php" class="classname">SimdJsonValueError</a></span> is thrown as of PECL simdjson 3.0.0,
   while previously, an error of level <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> was raised.
  </p>
 </div>

 <div class="refsect1 seealso" id="refsect1-function.simdjson-key-value-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <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.simdjson-decode.php" class="function" rel="rdfs-seeAlso">simdjson_decode()</a> - Decodes a JSON string</span></li>
  </ul>
 </div>

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