<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.igbinary.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'function.igbinary-unserialize.php',
    1 => 'igbinary_unserialize',
    2 => 'Creates a PHP value from a stored representation from igbinary_serialize',
  ),
  'up' => 
  array (
    0 => 'ref.igbinary.php',
    1 => 'Igbinary 函数',
  ),
  'prev' => 
  array (
    0 => 'function.igbinary-serialize.php',
    1 => 'igbinary_serialize',
  ),
  'next' => 
  array (
    0 => 'book.json.php',
    1 => 'JSON',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/igbinary/functions/igbinary-unserialize.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.igbinary-unserialize" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">igbinary_unserialize</h1>
  <p class="verinfo">(PECL igbinary &gt;= 1.1.1)</p><p class="refpurpose"><span class="refname">igbinary_unserialize</span> &mdash; <span class="dc-title">
   Creates a PHP value from a stored representation from <span class="function"><a href="function.igbinary-serialize.php" class="function">igbinary_serialize()</a></span>
  </span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.igbinary-unserialize-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>igbinary_unserialize</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$str</code></span>): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>

  <p class="simpara">
   <span class="function"><strong>igbinary_unserialize()</strong></span> takes a single serialized variable from
   <span class="function"><a href="function.igbinary-serialize.php" class="function">igbinary_serialize()</a></span> and converts it back into a PHP value.
  </p>
  <div class="warning"><strong class="warning">警告</strong>
   <p class="simpara">
    Untrusted user input must not be passed to <span class="function"><strong>igbinary_unserialize()</strong></span>.
    Unserialization can result in code being loaded and executed due to object
    instantiation and autoloading, and a malicious user may be able to exploit
    this. Instead a safe, standard data interchange format such as JSON (via
    <span class="function"><a href="function.json-decode.php" class="function">json_decode()</a></span> and <span class="function"><a href="function.json-encode.php" class="function">json_encode()</a></span>) should be used,
    if serialized data needs to be passed to a client.
   </p>
   <p class="simpara">
    If there is the need to unserialize externally-stored serialized data,
    <span class="function"><a href="function.hash-hmac.php" class="function">hash_hmac()</a></span> can be used for data validation.
    It is important to ensure that nobody has tampered with the data.
   </p>
  </div>
  <div class="warning"><strong class="warning">警告</strong>
   <p class="simpara">
    The igbinary serialization format does not provide a way to distinguish between different reference
    groups for the same value. All PHP references to a given value as treated as part
    of the same reference group when unserialized,
    even if they were parts of difference reference groups when serialized.
   </p>
  </div>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.igbinary-unserialize-parameters">
  <h3 class="title">参数</h3>
  <dl>
   
    <dt><code class="parameter">str</code></dt>
    <dd>
     <span class="simpara">
      The serialized string generated by <span class="function"><a href="function.igbinary-serialize.php" class="function">igbinary_serialize()</a></span>.
     </span>
     <span class="simpara">
      If the value being unserialized is an <span class="type"><a href="language.types.object.php" class="type object">object</a></span>, after successfully
      reconstructing the object igbinary will automatically attempt to call the
      <a href="language.oop5.magic.php#object.unserialize" class="link">__unserialize()</a> or
      <a href="language.oop5.magic.php#object.wakeup" class="link">__wakeup()</a> methods (if one exists).
     </span>
     <blockquote class="note"><p><strong class="note">注意</strong>: 
      <strong>
       <a href="var.configuration.php#ini.unserialize-callback-func" class="link">unserialize_callback_func</a>
        directive
      </strong><br />
      <span class="simpara">
       The callback specified in the
       <a href="var.configuration.php#ini.unserialize-callback-func" class="link">unserialize_callback_func</a>
       directive is called when an undefined class is unserialized.
       If no callback is specified, the object will be instantiated as
       <span class="classname"><a href="class.php-incomplete-class.php" class="classname">__PHP_Incomplete_Class</a></span>.
      </span>
     </p></blockquote>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.igbinary-unserialize-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="simpara">
   The converted value is returned, and can be a <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span>,
   <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>, <span class="type"><a href="language.types.float.php" class="type float">float</a></span>, <span class="type"><a href="language.types.string.php" class="type string">string</a></span>,
   <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>, or <span class="type"><a href="language.types.null.php" class="type null">null</a></span>.
  </p>
  <p class="simpara">
   In case the passed string is not unserializeable, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> is returned and
   <strong><code><a href="errorfunc.constants.php#constant.e-notice">E_NOTICE</a></code></strong> or <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> is issued.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.igbinary-unserialize-errors">
  <h3 class="title">错误／异常</h3>
  <p class="simpara">
   Objects may throw <span class="classname"><a href="class.throwable.php" class="classname">Throwable</a></span>s in their unserialization handlers.
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.igbinary-unserialize-notes">
  <h3 class="title">注释</h3>
  <div class="warning"><strong class="warning">警告</strong>
   <p class="simpara">
    <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> is returned both in the case of an error and if unserializing
    the serialized <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> value. It is possible to catch this special case by
    comparing <code class="parameter">str</code> with
    <code class="code">igbinary_serialize(null)</code> or <code class="code">igbinary_serialize(false)</code>
    or by catching the issued <strong><code><a href="errorfunc.constants.php#constant.e-notice">E_NOTICE</a></code></strong>.
   </p>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.igbinary-unserialize-seealso">
  <h3 class="title">参见</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.unserialize.php" class="function" rel="rdfs-seeAlso">unserialize()</a> - 从已存储的表示中创建 PHP 的值</span></li>
   <li><span class="function"><a href="function.json-encode.php" class="function" rel="rdfs-seeAlso">json_encode()</a> - 对变量进行 JSON 编码</span></li>
   <li><span class="function"><a href="function.json-decode.php" class="function" rel="rdfs-seeAlso">json_decode()</a> - 对 JSON 格式的字符串进行解码</span></li>
   <li><span class="function"><a href="function.hash-hmac.php" class="function" rel="rdfs-seeAlso">hash_hmac()</a> - 使用 HMAC 方法生成带有密钥的散列值</span></li>
   <li><span class="function"><a href="function.igbinary-serialize.php" class="function" rel="rdfs-seeAlso">igbinary_serialize()</a> - Generates a compact, storable binary representation of a value</span></li>
   <li><a href="language.oop5.autoload.php" class="link">Autoloading Classes</a></li>
   <li><a href="var.configuration.php#ini.unserialize-callback-func" class="link">unserialize_callback_func</a></li>
   <li><a href="language.oop5.magic.php#object.wakeup" class="link">__wakeup()</a></li>
   <li><a href="language.oop5.magic.php#object.serialize" class="link">__serialize()</a></li>
   <li><a href="language.oop5.magic.php#object.unserialize" class="link">__unserialize()</a></li>
  </ul>
 </div>

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