<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/migration81.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'migration81.other-changes.php',
    1 => '其他变更',
    2 => '其他变更',
  ),
  'up' => 
  array (
    0 => 'migration81.php',
    1 => '从 PHP 8.0.x 移植到 PHP 8.1.x',
  ),
  'prev' => 
  array (
    0 => 'migration81.deprecated.php',
    1 => 'PHP 8.1.x 废弃的功能',
  ),
  'next' => 
  array (
    0 => 'migration80.php',
    1 => '从 PHP 7.4.x 移植到 PHP 8.0.x',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'appendices/migration81/other-changes.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="migration81.other-changes" class="sect1">
 <h2 class="title">其他变更</h2>

 <div class="sect2" id="migration81.other-changes.sapi">
  <h3 class="title">SAPI 模块的变更</h3>

  <div class="sect3" id="migration81.other-changes.sapi.cli">
   <h4 class="title">CLI</h4>

   <p class="para">
    如果没有安装 <a href="book.readline.php" class="link">readline 扩展</a>，使用
    <strong class="option unknown">-a</strong> 选项现在将导致错误。在之前，如果没有 readline 扩展的话 <strong class="option unknown">-a</strong>
    与直接无参数调用 <strong class="command">php</strong> 的表现一样，除了额外显示一行
    <code class="literal">&quot;Interactive mode enabled&quot;</code> 消息。这个模式<em>非交互模式</em>。
   </p>
  </div>

  <div class="sect3" id="migration81.other-changes.sapi.phpdbg">
   <h4 class="title">PHPDBG</h4>

   <p class="para">
    <a href="book.phpdbg.php" class="link">phpdbg</a> 的远程功能已经被移除。
   </p>
  </div>
 </div>

 <div class="sect2" id="migration81.other-changes.functions">
  <h3 class="title">函数的变更</h3>

  <div class="sect3" id="migration81.other-changes.functions.core">
   <h4 class="title">核心</h4>

   <p class="para">
    在 <a href="control-structures.foreach.php" class="link"><code class="literal">foreach</code></a>、<span class="function"><a href="function.var-dump.php" class="function">var_dump()</a></span>、<span class="function"><a href="function.serialize.php" class="function">serialize()</a></span>、对象比较等场景中属性的顺序发生了改变。现在，属性将根据它们的声明与继承进行排序，在基类中声明的属性将排在子类属性之前。
   </p>
   <p class="para">
    这个顺序与 <code class="code">zend_object</code> 结构中属性的内部布局保持一致，并且重复了
    <code class="code">default_properties_table[]</code> 和 <code class="code">properties_info_table[] </code>
    中的顺序。旧的顺序没有被记录下来，是由类的继承实现细节造成的。
   </p>
  </div>

  <div class="sect3" id="migration81.other-changes.functions.filter">
   <h4 class="title">Filter</h4>

   <p class="para">
    <strong><code><a href="filter.constants.php#constant.filter-validate-int">FILTER_VALIDATE_INT</a></code></strong> 过滤器的 <strong><code><a href="filter.constants.php#constant.filter-flag-allow-octal">FILTER_FLAG_ALLOW_OCTAL</a></code></strong>
    标识现在接受带八进制前缀（<code class="literal">&quot;0o&quot;</code>/<code class="literal">&quot;0O&quot;</code>）的八进制字符串。
   </p>
  </div>

  <div class="sect3" id="migration81.other-changes.functions.gmp">
   <h4 class="title">GMP</h4>

   <p class="para">
    所有的 <a href="book.gmp.php" class="link">GMP</a> 函数现在接受带八进制前缀（<code class="literal">&quot;0o&quot;</code>/<code class="literal">&quot;0O&quot;</code>）的八进制字符串。
   </p>
  </div>

  <div class="sect3" id="migration81.other-changes.functions.pdo-odbc">
   <h4 class="title">PDO ODBC</h4>

   <p class="para">
    带着 <strong><code><a href="pdo.constants.php#pdo.constants.attr-server-info">PDO::ATTR_SERVER_INFO</a></code></strong> 和
    <strong><code><a href="pdo.constants.php#pdo.constants.attr-server-version">PDO::ATTR_SERVER_VERSION</a></code></strong> 常量的
    <span class="methodname"><a href="pdo.getattribute.php" class="methodname">PDO::getAttribute()</a></span>
    方法现在返回的是值而不是抛出 <span class="classname"><a href="class.pdoexception.php" class="classname">PDOException</a></span> 异常。
   </p>
  </div>

  <div class="sect3" id="migration81.other-changes.functions.reflection">
   <h4 class="title">Reflection</h4>

   <p class="para">
    <span class="methodname"><a href="reflectionproperty.setaccessible.php" class="methodname">ReflectionProperty::setAccessible()</a></span> 和
    <span class="methodname"><a href="reflectionmethod.setaccessible.php" class="methodname">ReflectionMethod::setAccessible()</a></span>
    将不再起作用。属性和方法现在总被认为是能够通过反射访问的。
   </p>
  </div>

  <div class="sect3" id="migration81.other-changes.functions.standard">
   <h4 class="title">常规</h4>

   <p class="para">
    <span class="function"><a href="function.syslog.php" class="function">syslog()</a></span> 现在是二进制安全的。
   </p>
  </div>
 </div>

 <div class="sect2" id="migration81.other-changes.extensions">
  <h3 class="title">其他扩展变更</h3>

  <div class="sect3" id="migration81.other-changes.extensions.gd">
   <h4 class="title">GD</h4>

   <p class="para">
    <span class="function"><a href="function.imagewebp.php" class="function">imagewebp()</a></span> 现在可以通过传递 <strong><code><a href="image.constants.php#constant.img-webp-lossless">IMG_WEBP_LOSSLESS</a></code></strong>
    作为质量来实现无损的 WebP 编码了。
   </p>
   <p class="para">
    这个常量只有在所使用的 libgd 支持无损 WebP 编码的情况在才会被定义。
   </p>
  </div>

  <div class="sect3" id="migration81.other-changes.extensions.mysqli">
   <h4 class="title">MySQLi</h4>

   <p class="para">
    在连接 libmysqlclient 时，<span class="methodname"><a href="mysqli-stmt.next-result.php" class="methodname">mysqli_stmt::next_result()</a></span>
    和 <span class="methodname"><strong>mysqli::fetch_all()</strong></span> 现在可以使用了。
   </p>
  </div>

  <div class="sect3" id="migration81.other-changes.extensions.openssl">
   <h4 class="title">OpenSSL</h4>

   <ul class="itemizedlist">
    <li class="listitem">
     <p class="para">
      <a href="book.openssl.php" class="link">OpenSSL 扩展</a>现在至少需要 OpenSSL 1.0.2 版本。
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      现在已经支持 OpenSSL 3.0 了。请注意许多密码算法（部分老的提供者）不再是默认启用的，以及参数校验（例如：最小秘钥长度）比以前更加严格了。
     </p>
    </li>
   </ul>
  </div>

  <div class="sect3" id="migration81.other-changes.extensions.phar">
   <h4 class="title">Phar</h4>

   <ul class="itemizedlist">
    <li class="listitem">
     <p class="para">
       现在签名的默认算法为 SHA256。
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      签名算法增加了对 OpenSSL_SHA256 和 OpenSSL_SHA512 的支持。
     </p>
    </li>
   </ul>
  </div>

  <div class="sect3" id="migration81.other-changes.extensions.snmp">
   <h4 class="title">SNMP</h4>

   <ul class="itemizedlist">
    <li class="listitem">
     <p class="para">
      为安全协议增加了对 SHA256 和 SHA512 的支持。
     </p>
    </li>
   </ul>
  </div>

  <div class="sect3" id="migration81.other-changes.extensions.standard">
   <h4 class="title">常规</h4>

   <p class="para">
    <code class="code">--with-password-argon2</code> 现在使用 pkg-config 来检测
    libargon2。因此现在应该使用 <var class="envar">PKG_CONFIG_PATH</var>
    来修改 libargon2 的位置。
   </p>
  </div>
 </div>

 <div class="sect2" id="migration81.other-changes.ini">
  <h3 class="title">INI 文件处理的变化</h3>

  <ul class="itemizedlist">
   <li class="listitem">
    <p class="para">
     INI 配置项 <a href="errorfunc.configuration.php#ini.log-errors-max-len" class="link">log_errors_max_len</a> 已经被移除。从 PHP 8.0.0 开始将不再起作用。
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     一个在引用字符串中的前置美元符号现在可以被转义：<code class="literal">&quot;\${&quot;</code>
     将会被解释为内容包含 <code class="literal">${</code> 的字符串。
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     双引号内的字符串中反斜线现在被更一致地视为转义字符。之前 <code class="literal">&quot;foo\\&quot;</code>
     的后面如果是除换行之外的其他字符是不被视为一个终止字符串的。现在，它被解释成一个内容为
     <code class="literal">foo\</code> 的字符串。然而有一个例外的地方是后面跟着换行符的字符串 <code class="literal">&quot;foo\&quot;</code>
     将继续被视为一个有效的、内容为“foo\”的字符串，而不是一个还没有结束的字符串。这个例外的存在是为了天然支持 Windows 文件路径的使用，如
     <code class="literal">&quot;C:\foo\&quot;</code>。
    </p>
   </li>
  </ul>
 </div>

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