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

contributors($setup);

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

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

  <div class="sect3" id="migration80.other-changes.sapi.apache2handler">
   <h4 class="title">Apache2Handler</h4>

   <p class="para">
    PHP 模块从 <code class="literal">php7_module</code> 重命名为
    <code class="literal">php_module</code>。
   </p>
  </div>
 </div>

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

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

   <p class="para">
    可通过新参数 <code class="parameter">filter</code> 来过滤 <span class="methodname"><a href="reflectionclass.getconstants.php" class="methodname">ReflectionClass::getConstants()</a></span> 和
    <span class="methodname"><a href="reflectionclass.getreflectionconstants.php" class="methodname">ReflectionClass::getReflectionConstants()</a></span> 的返回结果。
    新增三个常量，搭配使用：
   </p>
   <p class="para">
    <ul class="simplelist">
     <li><strong><code><a href="class.reflectionclassconstant.php#reflectionclassconstant.constants.is-public">ReflectionClassConstant::IS_PUBLIC</a></code></strong></li>
     <li><strong><code><a href="class.reflectionclassconstant.php#reflectionclassconstant.constants.is-protected">ReflectionClassConstant::IS_PROTECTED</a></code></strong></li>
     <li><strong><code><a href="class.reflectionclassconstant.php#reflectionclassconstant.constants.is-private">ReflectionClassConstant::IS_PRIVATE</a></code></strong></li>
    </ul>
   </p>
  </div>

  <div class="sect3" id="migration80.other-changes.functions.standard">
   <h4 class="title">标准</h4>

   <p class="para">
    现在 math 函数 <span class="function"><a href="function.abs.php" class="function">abs()</a></span>、<span class="function"><a href="function.ceil.php" class="function">ceil()</a></span>、<span class="function"><a href="function.floor.php" class="function">floor()</a></span> 和 <span class="function"><a href="function.round.php" class="function">round()</a></span>
    可以正确的遵循 <a href="language.types.declarations.php#language.types.declarations.strict" class="link"><code class="literal">strict_types</code> 指令</a>。以前，即使在严格类型模式下，也会强制转换第一个参数。
   </p>
  </div>

  <div class="sect3" id="migration80.other-changes.functions.zip">
   <h4 class="title">Zip</h4>

   <ul class="itemizedlist">
    <li class="listitem">
     <p class="para">
      <span class="methodname"><a href="ziparchive.addglob.php" class="methodname">ZipArchive::addGlob()</a></span> 和
      <span class="methodname"><a href="ziparchive.addpattern.php" class="methodname">ZipArchive::addPattern()</a></span> 方法中 
      <code class="parameter">options</code> 数组参数可接受更多的值：
     </p>
     <p class="para">
      <ul class="simplelist">
       <li><code class="literal">flags</code></li>
       <li><code class="literal">comp_method</code></li>
       <li><code class="literal">comp_flags</code></li>
       <li><code class="literal">env_method</code></li>
       <li><code class="literal">enc_password</code></li>
      </ul>
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      <span class="methodname"><a href="ziparchive.addemptydir.php" class="methodname">ZipArchive::addEmptyDir()</a></span>、<span class="methodname"><a href="ziparchive.addfile.php" class="methodname">ZipArchive::addFile()</a></span>、<span class="methodname"><a href="ziparchive.addfromstring.php" class="methodname">ZipArchive::addFromString()</a></span>
      方法新增 <code class="parameter">flags</code> 参数。
      
      可用于名称编码（<strong><code><a href="zip.constants.php#ziparchive.constants.fl-enc-guess">ZipArchive::FL_ENC_<span class="replaceable">*</span></a></code></strong>）与条目（entry）替换（<strong><code><a href="zip.constants.php#ziparchive.constants.fl-overwrite">ZipArchive::FL_OVERWRITE</a></code></strong>）。
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      <span class="methodname"><a href="ziparchive.extractto.php" class="methodname">ZipArchive::extractTo()</a></span> 现在会储存文件的修改时间。
     </p>
    </li>
   </ul>
  </div>
 </div>

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

  <div class="sect3" id="migration80.other-changes.extensions.curl">
   <h4 class="title">CURL</h4>

   <ul class="itemizedlist">
    <li class="listitem">
     <p class="para">
      现在 CURL 扩展要求 libcurl 版本至少为 7.29.0。
     </p>
    </li>
    <li class="listitem">
     <p class="para">
     移除了 <span class="function"><a href="function.curl-version.php" class="function">curl_version()</a></span> 废弃的参数 <code class="parameter">version</code>。
     </p>
    </li>
   </ul>
  </div>

  <div class="sect3" id="migration80.other-changes.extensions.date">
   <h4 class="title">日期/时间</h4>

   <p class="para">
    现在 <span class="classname"><a href="class.dateperiod.php" class="classname">DatePeriod</a></span> 实现（implements）了 <span class="interfacename"><a href="class.iteratoraggregate.php" class="interfacename">IteratorAggregate</a></span>（之前是
    <span class="interfacename"><a href="class.traversable.php" class="interfacename">Traversable</a></span>）。
   </p>
  </div>

  <div class="sect3" id="migration80.other-changes.extensions.dom">
   <h4 class="title">DOM</h4>

   <p class="para">
    现在 <span class="classname"><a href="class.domnamednodemap.php" class="classname">DOMNamedNodeMap</a></span> 与 <span class="classname"><a href="class.domnodelist.php" class="classname">DOMNodeList</a></span> 实现（implements）了
    <span class="interfacename"><a href="class.iteratoraggregate.php" class="interfacename">IteratorAggregate</a></span>（之前是
    <span class="interfacename"><a href="class.traversable.php" class="interfacename">Traversable</a></span>）。
   </p>
  </div>

  <div class="sect3" id="migration80.other-changes.extensions.intl">
   <h4 class="title">国际化</h4>

   <p class="para">
    现在 <span class="classname"><a href="class.intlbreakiterator.php" class="classname">IntlBreakIterator</a></span> 与 <span class="classname"><a href="class.resourcebundle.php" class="classname">ResourceBundle</a></span> 实现（implements）了
    <span class="interfacename"><a href="class.iteratoraggregate.php" class="interfacename">IteratorAggregate</a></span>（之前是 <span class="interfacename"><a href="class.traversable.php" class="interfacename">Traversable</a></span>）。
   </p>
  </div>

  <div class="sect3" id="migration80.other-changes.extensions.enchant">
   <h4 class="title">Enchant</h4>

   <p class="para">
    现在环境允许时，enchant 会默认使用 libenchant-2。仍然支持 libenchant 1，但已经废弃，并将在未来移除。
   </p>
  </div>

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

   <ul class="itemizedlist">
    <li class="listitem">
     <p class="para">
      <span class="function"><a href="function.imagepolygon.php" class="function">imagepolygon()</a></span>、<span class="function"><a href="function.imageopenpolygon.php" class="function">imageopenpolygon()</a></span>、<span class="function"><a href="function.imagefilledpolygon.php" class="function">imagefilledpolygon()</a></span> 
      的参数 <code class="parameter">num_points</code> 现在为可选参数。这些函数可用三或四个参数去调用。省略参数时，会按 <code class="code">count($points)/2</code> 计算。
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      新增函数 <span class="function"><a href="function.imagegetinterpolation.php" class="function">imagegetinterpolation()</a></span>，可获取当前的插值（interpolation）。
     </p>
    </li>
   </ul>
  </div>

  <div class="sect3" id="migration80.other-changes.extensions.json">
   <h4 class="title">JSON</h4>

   <p class="para">
    现在无法禁用 JSON 扩展，将是任意 PHP 版本的内置功能，类似 date 扩展。
   </p>
  </div>

  <div class="sect3" id="migration80.other-changes.extensions.mbstring">
   <h4 class="title">MBString</h4>

   <p class="para">
   更新 Unicode 数据表版本到 13.0.0。
   </p>
  </div>

  <div class="sect3" id="migration80.other-changes.extensions.pdo">
   <h4 class="title">PDO</h4>

   <p class="para">
    现在 <span class="classname"><a href="class.pdostatement.php" class="classname">PDOStatement</a></span> 实现（implements）了
    <span class="interfacename"><a href="class.iteratoraggregate.php" class="interfacename">IteratorAggregate</a></span> (之前是
    <span class="interfacename"><a href="class.traversable.php" class="interfacename">Traversable</a></span>)。
   </p>
  </div>

  <div class="sect3" id="migration80.other-changes.extensions.libxml">
   <h4 class="title">LibXML</h4>

   <p class="para">
    现在要求 libxml 最小版本为 2.9.0。这代表着确保了默认情况下禁用了外部实体加载（external entity
    loading）的功能。无需额外步骤即可防范 XML 外部实体注入攻击（XXE attacks）。
   </p>
  </div>

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

   <ul class="itemizedlist">
    <li class="listitem">
     <p class="para">
     未使用 mysqlnd 时（也是默认且推荐的做法），支持的最小 libmysqlclient 版本为 5.5。
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      现在 <span class="classname"><a href="class.mysqli-result.php" class="classname">mysqli_result</a></span> 实现（implements）了
      <span class="interfacename"><a href="class.iteratoraggregate.php" class="interfacename">IteratorAggregate</a></span> (之前是
      <span class="interfacename"><a href="class.traversable.php" class="interfacename">Traversable</a></span>)。
     </p>
    </li>
   </ul>
  </div>

  <div class="sect3" id="migration80.other-changes.extensions.pgsql">
   <h4 class="title">PGSQL/PDO PGSQL</h4>

   <p class="para">
    PGSQL 与 PDO PGSQL 扩展需要 libpq 的版本号至少为 9.1。
   </p>
  </div>

  <div class="sect3" id="migration80.other-changes.extensions.readline">
   <h4 class="title">Readline</h4>

   <p class="para">
    在交互提示开始之前调用 <span class="function"><a href="function.readline-completion-function.php" class="function">readline_completion_function()</a></span>（例如在 <a href="ini.core.php#ini.auto-prepend-file" class="link">auto_prepend_file</a>
    中），将重写默认的交互输入补全函数。之前，只有交互提示（interactive prompt）开始后，<span class="function"><a href="function.readline-completion-function.php" class="function">readline_completion_function()</a></span> 才会运行。
   </p>
  </div>

  <div class="sect3" id="migration80.other-changes.extensions.simplexml">
   <h4 class="title">SimpleXML</h4>

   <p class="para">
    现在 <span class="classname"><a href="class.simplexmlelement.php" class="classname">SimpleXMLElement</a></span> 实现（implements）了
    <span class="interfacename"><a href="class.recursiveiterator.php" class="interfacename">RecursiveIterator</a></span> 并吸收了
    <span class="classname"><a href="class.simplexmliterator.php" class="classname">SimpleXMLIterator</a></span> 的功能。<span class="classname"><a href="class.simplexmliterator.php" class="classname">SimpleXMLIterator</a></span> 是 
    <span class="classname"><a href="class.simplexmlelement.php" class="classname">SimpleXMLElement</a></span> 的一个空扩展。
   </p>
  </div>
 </div>

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

  <ul class="itemizedlist">
   <li class="listitem">
    <p class="para">
     com.dotnet_version
     是一个新的 INI 指令，用于选择 <span class="classname"><a href="class.dotnet.php" class="classname">dotnet</a></span> 对象的 .NET framework 版本。
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     zend.exception_string_param_max_len
     是一个新的 INI 指令，用于设置字符串化的调用栈（stack strace）的最大字符串长度。
    </p>
   </li>
   </ul>
 </div>

 <div class="sect2" id="migration80.other-changes.ebcdic">
  <h3 class="title">EBCDIC</h3>

  <p class="para">
   不再支持 EBCDIC targets，虽然它不太可能还在当初的地方继续运行。
  </p>
 </div>

 <div class="sect2" id="migration80.other-changes.performance">
  <h3 class="title">性能</h3>

  <ul class="itemizedlist">
   <li class="listitem">
    <p class="para">
     opcache 扩展新增了即时编译（JIT）支持。
     
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     <span class="function"><a href="function.array-slice.php" class="function">array_slice()</a></span> 用于没有空隙的数组时，将不会扫描整个数组去查找开始的位移（offset）。在
     offset 较大、长度较小时，会显著减少函数的运行时间。
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     当本地化 <strong><code><a href="string.constants.php#constant.lc-ctype">LC_CTYPE</a></code></strong> 为 <code class="literal">&quot;C&quot;</code>
     时（也是默认值），<span class="function"><a href="function.strtolower.php" class="function">strtolower()</a></span> 会使用 SIMD 的实现。
    </p>
   </li>
  </ul>
 </div>

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