<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/migration56.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'migration56.incompatible.php',
    1 => 'Backward incompatible changes',
    2 => 'Backward incompatible changes',
  ),
  'up' => 
  array (
    0 => 'migration56.php',
    1 => 'Перехід від PHP 5.5.x до PHP 5.6.x',
  ),
  'prev' => 
  array (
    0 => 'migration56.php',
    1 => 'Перехід від PHP 5.5.x до PHP 5.6.x',
  ),
  'next' => 
  array (
    0 => 'migration56.new-features.php',
    1 => 'New features',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'appendices/migration56/incompatible.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="migration56.incompatible" class="sect1">
 <h2 class="title">Backward incompatible changes</h2>
 <p class="simpara">
  Although most existing PHP 5 code should work without changes, please take
  note of some backward incompatible changes:
 </p>

 <div class="sect2" id="migration56.incompatible.array-keys">
  <h3 class="title">Array keys won&#039;t be overwritten when defining an array as a property of a class via an array literal</h3>

  <p class="para">
   Previously, arrays declared as class properties which mixed explicit and
   implicit keys could have array elements silently overwritten if an explicit
   key was the same as a sequential implicit key. For example:
  </p>

  <div class="informalexample">
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">class </span><span style="color: #0000BB">C </span><span style="color: #007700">{<br />    const </span><span style="color: #0000BB">ONE </span><span style="color: #007700">= </span><span style="color: #0000BB">1</span><span style="color: #007700">;<br />    public </span><span style="color: #0000BB">$array </span><span style="color: #007700">= [<br />        </span><span style="color: #0000BB">self</span><span style="color: #007700">::</span><span style="color: #0000BB">ONE </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'foo'</span><span style="color: #007700">,<br />        </span><span style="color: #DD0000">'bar'</span><span style="color: #007700">,<br />        </span><span style="color: #DD0000">'quux'</span><span style="color: #007700">,<br />    ];<br />}<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">((new </span><span style="color: #0000BB">C</span><span style="color: #007700">)-&gt;</span><span style="color: #0000BB">array</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <p class="para">В PHP 5.5 поданий вище приклад 
виведе:</p>
   <div class="example-contents screen">
<div class="cdata"><pre>
array(2) {
  [0]=&gt;
  string(3) &quot;bar&quot;
  [1]=&gt;
  string(4) &quot;quux&quot;
}

</pre></div>
   </div>
   <p class="para">В PHP 5.6 поданий вище приклад
виведе:</p>
   <div class="example-contents screen">
<div class="cdata"><pre>
array(3) {
  [1]=&gt;
  string(3) &quot;foo&quot;
  [2]=&gt;
  string(3) &quot;bar&quot;
  [3]=&gt;
  string(4) &quot;quux&quot;
}
</pre></div>
   </div>
  </div>
 </div>

 <div class="sect2" id="migration56.incompatible.json-decode">
  <h3 class="title"><span class="function"><a href="function.json-decode.php" class="function">json_decode()</a></span> strictness</h3>

  <p class="para">
   <span class="function"><a href="function.json-decode.php" class="function">json_decode()</a></span> now rejects non-lowercase variants of the
   JSON literals <code class="literal">true</code>, <code class="literal">false</code> and
   <code class="literal">null</code> at all times, as per the JSON specification, and
   sets <span class="function"><a href="function.json-last-error.php" class="function">json_last_error()</a></span> accordingly. Previously, inputs
   to <span class="function"><a href="function.json-decode.php" class="function">json_decode()</a></span> that consisted solely of one of these
   values in upper or mixed case were accepted.
  </p>

  <p class="para">
   This change will only affect cases where invalid JSON was being passed to
   <span class="function"><a href="function.json-decode.php" class="function">json_decode()</a></span>: valid JSON input is unaffected and will
   continue to be parsed normally.
  </p>
 </div>

 <div class="sect2" id="migration56.incompatible.peer-verification">
  <h3 class="title">Stream wrappers now verify peer certificates and host names by default when using SSL/TLS</h3>

  
   <p class="para">
    Усі шифровані клієнтські потоки тепер вмикають однорангову перевірку.
    Використовується стандартний пакет CA від OpenSSL для перевірки
    однорангового сертифіката. Здебільшого не потрібно вносити жодних змін для
    зв&#039;язку із серверами, що мають дійсні сертифікати SSL, оскільки
    дистриб&#039;ютори зазвичай налаштовують OpenSSL на використання добре
    відомих пакетів CA.
   </p>

   <p class="para">
    Стандартний пакет CA може бути змінений для всього сервера за допомогою
    директив openssl.cafile або openssl.capath, а також для окремого запиту за
    допомогою опцій контексту
    <a href="context.ssl.php#context.ssl.cafile" class="link"><code class="parameter">cafile</code></a> або
    <a href="context.ssl.php#context.ssl.capath" class="link"><code class="parameter">capath</code></a>
    context options.
   </p>

   <p class="para">
    Хоча це не рекомендується, але можна вимкнути перевірку однорангового
    сертифіката в запиті, встановивши опцію контексту
    <a href="context.ssl.php#context.ssl.verify-peer" class="link"><code class="parameter">verify_peer</code></a>
    як <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, або вимкнути перевірку імені однорангового пристрою,
    встановивши опцію контексту
    <a href="context.ssl.php#context.ssl.verify-peer-name" class="link"><code class="parameter">verify_peer_name</code></a>
    як <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
   </p>

 </div>

 <div class="sect2" id="migration56.incompatible.gmp">
  <h3 class="title"><a href="book.gmp.php" class="link">GMP</a> resources are now objects</h3>

  <p class="para">
   <a href="book.gmp.php" class="link">GMP</a> resources are now objects. The
   functional API implemented in the GMP extension has not changed, and code
   should run unmodified unless it checks explicitly for a resource using
   <span class="function"><a href="function.is-resource.php" class="function">is_resource()</a></span> or similar.
  </p>
 </div>

 <div class="sect2" id="migration56.incompatible.mcrypt">
  <h3 class="title"><a href="book.mcrypt.php" class="link">Mcrypt</a> functions now require valid keys and IVs</h3>

  <p class="para">
   <span class="function"><a href="function.mcrypt-encrypt.php" class="function">mcrypt_encrypt()</a></span>, <span class="function"><a href="function.mcrypt-decrypt.php" class="function">mcrypt_decrypt()</a></span>,
   <span class="function"><strong>mcrypt_cbc()</strong></span>, <span class="function"><strong>mcrypt_cfb()</strong></span>,
   <span class="function"><strong>mcrypt_ecb()</strong></span>, <span class="function"><a href="function.mcrypt-generic.php" class="function">mcrypt_generic()</a></span> and
   <span class="function"><strong>mcrypt_ofb()</strong></span> will no longer accept keys or IVs with
   incorrect sizes, and block cipher modes that require IVs will now fail if
   an IV isn&#039;t provided.
  </p>
 </div>
 
 <div class="sect2" id="migration56.incompatible.curl">
  <h3 class="title"><a href="book.curl.php" class="link">cURL</a> file uploads</h3>

  <p class="para">
   Uploads using the @file syntax now require CURLOPT_SAFE_UPLOAD to be set to
   <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>. <span class="classname"><a href="class.curlfile.php" class="classname">CURLFile</a></span> should be used instead.
  </p>
 </div>
</div><?php manual_footer($setup); ?>