<?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 => 'ja',
  ),
  '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 => 'PHP 8.2.x で推奨されなくなる機能',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    '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 拡張モジュールは、ユーザー名/パスワードと接続文字列が両方渡された場合に、
   ユーザー名とパスワードをエスケープするようになりました。そして、
   エスケープ済みのものを接続文字列と結合することが必須になりました。
   これより前のバージョンでは、
   エスケープする必要がある値が含まれたユーザー指定の文字列によって、悪意ある接続文字列を生成される可能性がありました。
   また、ユーザー指定の文字列を値に注入されてしまう可能性もありました。
   このエスケープのルールは .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">
   <span class="function"><a href="function.glob.php" class="function">glob()</a></span> は、
   すべてのパスが <a href="ini.core.php#ini.open-basedir" class="link">open_basedir</a> によって制限されている場合に、
   空の配列を返すようになりました。
   これより前のバージョンでは、<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>

  <p class="para">
   <span class="methodname"><a href="filesystemiterator.construct.php" class="methodname">FilesystemIterator::__construct()</a></span> を使うと、
   以前のバージョンでは
   <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> は、ロケールに依存しなくなりました。
   これらは、ロケールが &quot;C&quot; であったかのように ASCII のケース変換を行います。
   これらの関数のロケール対応版は、<a href="book.mbstring.php" class="link">マルチバイト文字列</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="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> は、
   <strong><code><a href="array.constants.php#constant.sort-regular">SORT_REGULAR</a></code></strong> を使って数値形式の文字列の比較を行う際に、
   PHP 8 で標準になっているルールを使うようになりました。
  </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">Standard PHP Library (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">
   <span class="classname"><a href="class.globiterator.php" class="classname">GlobIterator</a></span> は、
   すべてのパスが <a href="ini.core.php#ini.open-basedir" class="link">open_basedir</a> によって制限されている場合に、
   空の配列を返すようになりました。
   これより前のバージョンでは、<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); ?>