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

contributors($setup);

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

 <div class="sect2" id="migration73.other-changes.core">
  <h3 class="title">PHP 核心</h3>

  <div class="sect3" id="migration73.other-changes.core.setcookie">
   <h4 class="title">Set(raw)cookie 函数接受 $option 数组参数</h4>

   <p class="para">
    <span class="function"><a href="function.setcookie.php" class="function">setcookie()</a></span> 和 <span class="function"><a href="function.setrawcookie.php" class="function">setrawcookie()</a></span> 现在还支持以下签名：
    <div class="methodsynopsis dc-description">
     <span class="methodname"><a href="function.setcookie.php" class="methodname">setcookie</a></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$name</code></span>, <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$value</code><span class="initializer"> = &quot;&quot;</span></span>, <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$options</code><span class="initializer"> = []</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

    <code class="literal">$options</code> 是关联数组，可以存在以下任意 key
    <code class="literal">&quot;expires&quot;</code>、<code class="literal">&quot;path&quot;</code>、<code class="literal">&quot;domain&quot;</code>、<code class="literal">&quot;secure&quot;</code>、<code class="literal">&quot;httponly&quot;</code>
    和 <code class="literal">&quot;samesite&quot;</code>。
   </p>
  </div>

  <div class="sect3" id="migration73.other-changes.core.syslog">
   <h4 class="title">新的 Syslog ini 配置</h4>

   <p class="para">
    如果 <a href="errorfunc.configuration.php#ini.error-log" class="link">error_log</a> 设置为
    <code class="literal">syslog</code>，则新增以下 ini 指令来自定义日志记录：
    <dl>
     
      <dt><a href="errorfunc.configuration.php#ini.syslog.facility" class="link">syslog.facility</a></dt>
      <dd>
       <span class="simpara">
        指定记录消息的程序类型。
       </span>
      </dd>
     
     
      <dt><a href="errorfunc.configuration.php#ini.syslog.filter" class="link">syslog.filter</a></dt>
      <dd>
       <span class="simpara">
        指定过滤纪录消息的过滤器类型，支持的过滤器类型——<code class="literal">all</code>、<code class="literal">no-ctrl</code>
        和 <code class="literal">ascii</code>。自 PHP 7.3.8 起，<code class="literal">raw</code>
        也可以使用，恢复了 syslog 在之前 PHP 版本中的行为方式。此过滤器还会影响
        <span class="function"><a href="function.syslog.php" class="function">syslog()</a></span> 的调用，
       </span>
      </dd>
     
     
      <dt><a href="errorfunc.configuration.php#ini.syslog.ident" class="link">syslog.ident</a></dt>
      <dd>
       <span class="simpara">
        指定在每条消息前面添加的标识符（ident）字符串。
       </span>
      </dd>
     
    </dl>
   </p>
  </div>

  <div class="sect3" id="migration73.other-changes.core.gc">
   <h4 class="title">垃圾回收机制</h4>

   <p class="para">
    <a href="features.gc.collecting-cycles.php" class="link">循环 GC</a>
    已增强，这可能会带来相当大的性能改进。
   </p>
  </div>

  <div class="sect3" id="migration73.other-changes.core.misc">
   <h4 class="title">其它</h4>

   <p class="para">
    <span class="function"><a href="function.var-export.php" class="function">var_export()</a></span> 现在导出 <span class="classname"><a href="class.stdclass.php" class="classname">stdClass</a></span>
    为数组转换为对象（<code class="code">(object) array( ... )</code>），而不是使用不存在的方法
    <span class="methodname"><strong>stdClass::__setState()</strong></span>。
   </p>

   <p class="para">
    <span class="function"><a href="function.debug-zval-dump.php" class="function">debug_zval_dump()</a></span> 已变更为跟 <span class="function"><a href="function.var-dump.php" class="function">var_dump()</a></span>
    一样的方式显示递归数组和对象。现在，不会重复展示两次了。
   </p>

   <p class="para">
    <span class="function"><a href="function.array-push.php" class="function">array_push()</a></span> 和 <span class="function"><a href="function.array-unshift.php" class="function">array_unshift()</a></span> 现在也可以使用单个参数调用，这对于展开运算符来说尤其方便。
   </p>
  </div>

 </div>

 <div class="sect2" id="migration73.other-changes.phpdbg">
  <h3 class="title">交互式 PHP 调试程序</h3>

  <p class="para">
   已移除未使用的常量 <strong><code><a href="phpdbg.constants.php#constant.phpdbg-file">PHPDBG_FILE</a></code></strong>、<strong><code><a href="phpdbg.constants.php#constant.phpdbg-method">PHPDBG_METHOD</a></code></strong>、<strong><code><a href="phpdbg.constants.php#constant.phpdbg-lineno">PHPDBG_LINENO</a></code></strong>
   和 <strong><code><a href="phpdbg.constants.php#constant.phpdbg-func">PHPDBG_FUNC</a></code></strong>。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.fpm">
  <h3 class="title">FastCGI 进程管理器</h3>

  <p class="para">
   <span class="function"><a href="function.getallheaders.php" class="function">getallheaders()</a></span> 函数现已可用。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.curl">
  <h3 class="title">客户端 URL 库</h3>

  <p class="para">
   现在需要 libcurl ≥ 7.15.5。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.filter">
  <h3 class="title">数据过滤</h3>

  <p class="para">
   <strong><code><a href="filter.constants.php#constant.filter-validate-float">FILTER_VALIDATE_FLOAT</a></code></strong> 现在还支持 <code class="literal">thousand</code>
   选项，该选项定义允许的千位分隔符集合。默认值（<code class="code">&quot;&#039;,.&quot;</code>）与以前的 PHP 版本完全向后兼容。
  </p>

  <p class="para">
   <strong><code><a href="filter.constants.php#constant.filter-sanitize-add-slashes">FILTER_SANITIZE_ADD_SLASHES</a></code></strong> 已添加为 <code class="literal">magic_quotes</code>
   过滤器（<strong><code><a href="filter.constants.php#constant.filter-sanitize-magic-quotes">FILTER_SANITIZE_MAGIC_QUOTES</a></code></strong>）的别名。 <code class="literal">magic_quotes</code>
   过滤器可能会在未来的 PHP 版本中移除。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.ftp">
  <h3 class="title">FTP</h3>

  <p class="para">
   默认传输模式已更改为 <code class="literal">binary</code>。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.intl">
  <h3 class="title">国际化相关函数</h3>

  <p class="para">
   当 PHP 链接到 ICU ≥ 56 时，<strong><code>Normalizer::NONE</code></strong> 已弃用。
  </p>

  <p class="para">
   引入了 <strong><code><a href="class.normalizer.php#normalizer.constants.form-kc-cf">Normalizer::FORM_KC_CF</a></code></strong> 作为 <code class="literal">NFKC_Casefold</code> 标准化的
   <span class="methodname"><a href="normalizer.normalize.php" class="methodname">Normalizer::normalize()</a></span> 参数；当与 ICU ≥ 56 链接时可用。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.json">
  <h3 class="title">JavaScript 对象表示法</h3>

  <p class="para">
   添加了新 <strong><code><a href="json.constants.php#constant.json-throw-on-error">JSON_THROW_ON_ERROR</a></code></strong> flag，可以与 <span class="function"><a href="function.json-decode.php" class="function">json_decode()</a></span> 或 <span class="function"><a href="function.json-encode.php" class="function">json_encode()</a></span>
   一起使用，并导致这些函数在发生错误时抛出新的 <span class="classname"><a href="class.jsonexception.php" class="classname">JsonException</a></span>，而不是使用 <span class="function"><a href="function.json-last-error.php" class="function">json_last_error()</a></span> 和
   <span class="function"><a href="function.json-last-error-msg.php" class="function">json_last_error_msg()</a></span> 检索全局错误状态。<strong><code><a href="json.constants.php#constant.json-partial-output-on-error">JSON_PARTIAL_OUTPUT_ON_ERROR</a></code></strong> 优先于
   <strong><code><a href="json.constants.php#constant.json-throw-on-error">JSON_THROW_ON_ERROR</a></code></strong>。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.mbstring">
  <h3 class="title">多字节字符串</h3>

  <p class="para">
   配置项 <strong class="option configure">--with-libmbfl</strong> 不再可用。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.uodbc">
  <h3 class="title">ODBC (Unified)</h3>

  <p class="para">
   已移除对 <code class="literal">ODBCRouter</code> 和 <code class="literal">Birdstep</code> 的支持（包括 <code class="literal">birdstep.max_links</code> ini 指令）。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.opcache">
  <h3 class="title">OPcache</h3>

  <p class="para">
   <code class="literal">opcache.inherited_hack</code> ini 指令已移除。自 PHP 5.3.0 起，已忽略该值。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.openssl">
  <h3 class="title">OpenSSL</h3>

  <p class="para">
   添加了 <code class="literal">min_proto_version</code> 和 <code class="literal">max_proto_version</code> ssl stream 选项以及可能的 TLS 协议值的相关常量。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.pcre">
  <h3 class="title">正则表达式（Perl 兼容）</h3>

  <p class="para">
   <a href="book.pcre.php" class="link">PCRE 扩展</a>已升级到 PCRE2，这可能会导致出现细微的行为变化（例如，现在对类中的字符范围进行更严格的解释），并增强了现有的正则表达式语法。
  </p>

  <p class="para">
   <span class="function"><a href="function.preg-quote.php" class="function">preg_quote()</a></span> 现在也转义 <code class="literal">&#039;#&#039;</code> 字符。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.pdo-dblib">
  <h3 class="title">Microsoft SQL Server 和 Sybase 函数（PDO_DBLIB）</h3>

  <p class="para">
   添加了属性 <strong><code>PDO::DBLIB_ATTR_SKIP_EMPTY_ROWSETS</code></strong> 以启用自动跳过 rowset。
  </p>

  <p class="para">
   添加了公开 TDS 版本的 <strong><code>PDO::DBLIB_ATTR_TDS_VERSION</code></strong> 属性。
  </p>

  <p class="para">
    DATETIME2 列现在被视为 DATETIME 列。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.pdo-sqlite">
  <h3 class="title">SQLite 函数（PDO_SQLITE）</h3>

  <p class="para">
   现在可以通过将新的 <strong><code>PDO::SQLITE_ATTR_OPEN_FLAGS</code></strong> 属性设置 <strong><code>PDO::SQLITE_OPEN_READONLY</code></strong> 以只读模式打开 SQLite3 数据库。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.session">
  <h3 class="title">Session 处理</h3>

  <p class="para">
   <span class="function"><a href="function.session-set-cookie-params.php" class="function">session_set_cookie_params()</a></span> 现在还支持以下签名：
   <div class="methodsynopsis dc-description">
    <span class="methodname"><a href="function.session-set-cookie-params.php" class="methodname">session_set_cookie_params</a></span>(<span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$options</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

   其中 <code class="literal">$options</code> 是关联数组，可以存在以下任意 key
   <code class="literal">&quot;lifetime&quot;</code>、<code class="literal">&quot;path&quot;</code>、<code class="literal">&quot;domain&quot;</code>、<code class="literal">&quot;secure&quot;</code>、<code class="literal">&quot;httponly&quot;</code>
   和 <code class="literal">&quot;samesite&quot;</code>。因此，<span class="function"><a href="function.session-get-cookie-params.php" class="function">session_get_cookie_params()</a></span> 的返回值现在也有带有 <code class="literal">&quot;samesite&quot;</code> key
   的元素。此外，还添加了新的 <code class="literal">session.cookie_samesite</code> ini 选项来设置 cookie 的 SameSite 指令的默认值。默认为 <code class="literal">&quot;&quot;</code>（空字符串），因此未设置
   SameSite 指令。可以设置为 <code class="literal">&quot;Lax&quot;</code> 或 <code class="literal">&quot;Strict&quot;</code>，这会设置相应的 SameSite 指令。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.tidy">
  <h3 class="title">Tidy</h3>

  <p class="para">
   现在也透明地支持针对 <a href="https://github.com/petdance/tidyp" class="link external">&raquo;&nbsp;tidyp</a> 进行编译。由于 tidyp 没有提供 API 来获取发布日期，因此
   <span class="function"><a href="tidy.getrelease.php" class="function">tidy_get_release()</a></span> 和 <span class="methodname"><a href="tidy.getrelease.php" class="methodname">tidy::getRelease()</a></span> 在这种情况下返回 <code class="literal">&#039;unknown&#039;</code>。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.xml">
  <h3 class="title">XML 解析器</h3>

  <p class="para">
   如果扩展是针对 libxml 编译，则不再忽略 <span class="function"><a href="function.xml-set-external-entity-ref-handler.php" class="function">xml_set_external_entity_ref_handler()</a></span>
   回调的返回值。以前，会忽略返回值，并且不会停止解析。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.zip">
  <h3 class="title">Zip</h3>

  <p class="para">
   不建议针对捆绑的 libzip 进行编译，但通过在配置中添加 <strong class="option configure">--without-libzip</strong> 仍然可以实现。
  </p>
 </div>

 <div class="sect2" id="migration73.other-changes.zlib">
  <h3 class="title">Zlib 压缩</h3>

  <p class="para">
   <a href="wrappers.compression.php" class="link">compress.zlib 包装器</a>添加了 zlib/level
   上下文选项，以方便设置所需的压缩级别。
  </p>
 </div>

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