<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/migration82.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'zh',
  ),
  'this' => 
  array (
    0 => 'migration82.incompatible.php',
    1 => '不向后兼容的变更',
    2 => '不向后兼容的变更',
  ),
  'up' => 
  array (
    0 => 'migration82.php',
    1 => '从 PHP 8.1.x 移植到 PHP 8.2.x',
  ),
  'prev' => 
  array (
    0 => 'migration82.constants.php',
    1 => '新全局常量',
  ),
  'next' => 
  array (
    0 => 'migration82.deprecated.php',
    1 => '废弃的功能',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'zh',
    'path' => 'appendices/migration82/incompatible.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="migration82.incompatible" class="sect1">
 <h2 class="title">不向后兼容的变更</h2>

 <div class="sect2" id="migration82.incompatible.date">
  <h3 class="title">Date</h3>

  <p class="para">
   现 <span class="methodname"><a href="datetime.createfromimmutable.php" class="methodname">DateTime::createFromImmutable()</a></span> 返回类型暂定为
   <span class="type">static</span>，之前是 <span class="type"><a href="class.datetime.php" class="type DateTime">DateTime</a></span>。
  </p>

  <p class="para">
   现 <span class="methodname"><a href="datetimeimmutable.createfrommutable.php" class="methodname">DateTimeImmutable::createFromMutable()</a></span> 返回类型暂定为
   <span class="type">static</span>，之前是 <span class="type"><a href="class.datetimeimmutable.php" class="type DateTimeImmutable">DateTimeImmutable</a></span>。
  </p>

  <p class="para">
   <a href="datetime.formats.php#datetime.formats.relative" class="link">相对格式</a>的 <code class="literal">number</code> 符号不再接受多个符号，比如 <code class="literal">+-2</code>。
  </p>
 </div>

 <div class="sect2" id="migration82.incompatible.odbc">
  <h3 class="title">ODBC</h3>

  <p class="para">
   ODBC 扩展对于 connection 字符串和 username/password 一起传递时，会对 username 和 password
   进行转义，并将其追加。之前，包含需要转义的用户值可能会创建格式错误的 connection
   字符串，或从用户提供的数据中注入值。转义规则应与 .NET BCL DbConnectionOptions 的行为相同。
  </p>
 </div>

 <div class="sect2" id="migration82.incompatible.pdo-odbc">
  <h3 class="title">PDO_ODBC</h3>

  <p class="para">
   当传递连接字符串时，PDO_ODBC 扩展也会转义用户名和密码。参阅 <a href="migration82.incompatible.php#migration82.incompatible.odbc" class="link">ODBC 扩展的更改</a>获取更多相信信息。
  </p>
 </div>

 <div class="sect2" id="migration82.incompatible.standard">
  <h3 class="title">标准</h3>

  <p class="para">
   如果所有路径都受到 <a href="ini.core.php#ini.open-basedir" class="link">open_basedir</a>
   限制，现在 <span class="function"><a href="function.glob.php" class="function">glob()</a></span> 会返回空 <span class="type"><a href="language.types.array.php" class="type array">array</a></span>。此外，即便只有一些路径受到
   <a href="ini.core.php#ini.open-basedir" class="link">open_basedir</a> 限制，也会发出警告。
  </p>

  <p class="para">
   <span class="methodname"><a href="filesystemiterator.construct.php" class="methodname">FilesystemIterator::__construct()</a></span>：在 PHP 8.2.0 之前，<strong><code><a href="class.filesystemiterator.php#filesystemiterator.constants.skip-dots">FilesystemIterator::SKIP_DOTS</a></code></strong>
   常量始终设置且无法禁用。当使用 <code class="parameter">flags</code> 参数时，为了保持之前的行为，常量必须显式设置。<code class="parameter">flags</code>
   参数的默认值并未修改。
  </p>

  <p class="para">
   <span class="function"><a href="function.strtolower.php" class="function">strtolower()</a></span>、<span class="function"><a href="function.strtoupper.php" class="function">strtoupper()</a></span>、<span class="function"><a href="function.stristr.php" class="function">stristr()</a></span>、<span class="function"><a href="function.stripos.php" class="function">stripos()</a></span>、<span class="function"><a href="function.strripos.php" class="function">strripos()</a></span>、<span class="function"><a href="function.lcfirst.php" class="function">lcfirst()</a></span>、<span class="function"><a href="function.ucfirst.php" class="function">ucfirst()</a></span>、<span class="function"><a href="function.ucwords.php" class="function">ucwords()</a></span>
   和 <span class="function"><a href="function.str-ireplace.php" class="function">str_ireplace()</a></span> 不再对区域设置敏感。现在执行 ASCII
   大小写转换，就好像区域设置是“C”一样。这些函数的本地化版本在 <a href="book.mbstring.php" class="link">MBString
   扩展</a> 可以使用。此外 <span class="function"><a href="function.array-change-key-case.php" class="function">array_change_key_case()</a></span>
   使用 <strong><code><a href="array.constants.php#constant.sort-flag-case">SORT_FLAG_CASE</a></code></strong> 排序现在也是用 ASCII 大小写转换。 
  </p>

  <p class="para">
   <span class="function"><a href="function.str-split.php" class="function">str_split()</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="function"><a href="function.mb-str-split.php" class="function">mb_str_split()</a></span> 
   不受更改的影响，因为它的行为就是如此。
  </p>

  <p class="para">
   <span class="function"><a href="function.ksort.php" class="function">ksort()</a></span> 和 <span class="function"><a href="function.krsort.php" class="function">krsort()</a></span> 现在使用 PHP 8 标准规则在
   <strong><code><a href="array.constants.php#constant.sort-regular">SORT_REGULAR</a></code></strong> 下进行数字字符串比较。
  </p>

  <p class="para">
   <span class="function"><a href="function.var-export.php" class="function">var_export()</a></span> 不再省略导出类的开头斜线，也就是说，这些类现在完全合格。
  </p>
 </div>

 <div class="sect2" id="migration82.incompatible.spl">
  <h3 class="title">PHP 标准库（SPL）</h3>

  <p class="para">
   下列方法现在强制执行其签名：
   <ul class="simplelist">
    <li><span class="methodname"><strong>SplFileInfo::_bad_state_ex()</strong></span></li>
    <li><span class="methodname"><a href="splfileobject.getcsvcontrol.php" class="methodname">SplFileObject::getCsvControl()</a></span></li>
    <li><span class="methodname"><a href="splfileobject.fflush.php" class="methodname">SplFileObject::fflush()</a></span></li>
    <li><span class="methodname"><a href="splfileobject.ftell.php" class="methodname">SplFileObject::ftell()</a></span></li>
    <li><span class="methodname"><a href="splfileobject.fgetc.php" class="methodname">SplFileObject::fgetc()</a></span></li>
    <li><span class="methodname"><a href="splfileobject.fpassthru.php" class="methodname">SplFileObject::fpassthru()</a></span></li>
   </ul>
  </p>

  <p class="para">
   现 <span class="methodname"><a href="splfileobject.haschildren.php" class="methodname">SplFileObject::hasChildren()</a></span> 返回类型暂定为
   <span class="type"><a href="language.types.singleton.php" class="type false">false</a></span>，之前是 <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span>。
  </p>

  <p class="para">
   现 <span class="methodname"><a href="splfileobject.getchildren.php" class="methodname">SplFileObject::getChildren()</a></span> 返回类型暂定为
   <span class="type"><a href="language.types.null.php" class="type null">null</a></span>，之前是
   <span class="type">?</span><span class="type"><span class="type"><a href="class.recursiveiterator.php" class="type RecursiveIterator">RecursiveIterator</a></span><span class="type"></span></span>。
  </p>

  <p class="para">
   如果所有路径都受到 <a href="ini.core.php#ini.open-basedir" class="link">open_basedir</a> 的影响，<span class="classname"><a href="class.globiterator.php" class="classname">GlobIterator</a></span>
   现在将返回空 <span class="type"><a href="language.types.array.php" class="type array">array</a></span>。之前返回 <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>。此外，即使只有一些路径受
   <a href="ini.core.php#ini.open-basedir" class="link">open_basedir</a> 限制，现在也会发出警告。
  </p>
 </div>

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