<?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 => 'ja',
  ),
  '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' => 'ja',
    '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">PHP コア</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> 
    フラグは、
    8進数のプレフィックス
    (<code class="literal">&quot;0o&quot;</code>/<code class="literal">&quot;0O&quot;</code>)
    が先頭についた8進文字列を受け入れるようになりました。
   </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>
    関数が、
    8進数のプレフィックス
    (<code class="literal">&quot;0o&quot;</code>/<code class="literal">&quot;0O&quot;</code>)
    が先頭についた8進文字列を受け入れるようになりました。
   </p>
  </div>

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

   <p class="para">
    <span class="methodname"><a href="pdo.getattribute.php" class="methodname">PDO::getAttribute()</a></span> に 
    <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="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">リフレクション</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>
    関数の quality 引数に
    <strong><code><a href="image.constants.php#constant.img-webp-lossless">IMG_WEBP_LOSSLESS</a></code></strong>
    を指定することで、
    ロスレスエンコードが行えるようになりました。
   </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">
    configure オプション
    <code class="code">--with-password-argon2</code> は、
    libargon2 を検知するのに pkg-config を使うようになっています。
    そのため、libargon2 のインストール先を指定するには、
    <var class="envar">PKG_CONFIG_PATH</var> を使うべきです。
   </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> の後に改行文字以外の文字が続いた場合、
     文字列の終端とは見なされませんでした。
     PHP 8.1.0 以降では、<code class="literal">foo\</code>
     という文字列として解釈されるようになります。
     例外として、<code class="literal">&quot;foo\&quot;</code> の後に改行文字が続いた場合は、
     <code class="literal">foo\</code> という文字列として解釈されます。
     文字列が終端していないとは見なされません。
     但し、<code class="literal">&quot;C:\foo\&quot;</code> のような、
     Windows のファイルパスを使う場合には例外が存在します。
    </p>
   </li>
  </ul>
 </div>

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