<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/migration71.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'migration71.other-changes.php',
    1 => 'Other changes',
    2 => 'Other changes',
  ),
  'up' => 
  array (
    0 => 'migration71.php',
    1 => 'Migrating from PHP 7.0.x to PHP 7.1.x',
  ),
  'prev' => 
  array (
    0 => 'migration71.changed-functions.php',
    1 => 'Changed functions',
  ),
  'next' => 
  array (
    0 => 'migration71.windows-support.php',
    1 => 'Windows Support',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'appendices/migration71/other-changes.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="migration71.other-changes" class="sect1">
 <h2 class="title">Other changes</h2>

 <div class="sect2" id="migration71.other-changes.apprise-on-arithmetic-with-invalid-strings">
  <h3 class="title">Notices and warnings on arithmetic with invalid strings</h3>

  <p class="para">
   New <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> and <strong><code><a href="errorfunc.constants.php#constant.e-notice">E_NOTICE</a></code></strong> errors
   have been introduced when invalid strings are coerced using operators
   expecting numbers (<code class="literal">+</code> <code class="literal">-</code>
   <code class="literal">*</code> <code class="literal">/</code> <code class="literal">**</code>
   <code class="literal">%</code> <code class="literal">&lt;&lt;</code> <code class="literal">&gt;&gt;</code>
   <code class="literal">|</code> <code class="literal">&amp;</code> <code class="literal">^</code>) or their
   assignment equivalents. An <strong><code><a href="errorfunc.constants.php#constant.e-notice">E_NOTICE</a></code></strong> is emitted when the
   string begins with a numeric value but contains trailing non-numeric
   characters, and an <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> is emitted when the string
   does not contain a numeric value.
  </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: #DD0000">'1b' </span><span style="color: #007700">+ </span><span style="color: #DD0000">'something'</span><span style="color: #007700">;</span></span></code></div>
   </div>

   <p class="para">The above example will output:</p>
   <div class="example-contents screen">
<div class="cdata"><pre>
Notice: A non well formed numeric value encountered in %s on line %d
Warning: A non-numeric value encountered in %s on line %d
</pre></div>
   </div>
  </div>
 </div>

 <div class="sect2" id="migration71.other-changes.warn-on-octal-overflow">
  <h3 class="title">Warn on octal escape sequence overflow</h3>

  <p class="para">
   Previously, 3-octet octal string escape sequences would overflow silently.
   Now, they will still overflow, but <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> will be
   emitted.
  </p>

  <div class="informalexample">
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />var_dump</span><span style="color: #007700">(</span><span style="color: #DD0000">"\500"</span><span style="color: #007700">);</span></span></code></div>
   </div>

   <p class="para">The above example will output:</p>
   <div class="example-contents screen">
<div class="cdata"><pre>
Warning: Octal escape sequence overflow \500 is greater than \377 in %s on line %d
string(1) &quot;@&quot;
</pre></div>
   </div>
  </div>
 </div>

 <div class="sect2" id="migration71.other-changes.inconsistency-fixes-to-this">
  <h3 class="title">Inconsistency fixes to <code class="literal">$this</code></h3>

  <p class="para">
   Whilst <code class="literal">$this</code> is considered a special variable in PHP, it
   lacked proper checks to ensure it wasn&#039;t used as a variable name or
   reassigned. This has now been rectified to ensure that
   <code class="literal">$this</code> cannot be a user-defined variable, reassigned to a
   different value, or be globalised.
  </p>
 </div>

 <div class="sect2" id="migration71.other-changes.session-id-generation-without-hashing">
  <h3 class="title">Session ID generation without hashing</h3>

  <p class="para">
   Session IDs will no longer be hashed upon generation. With this change
   brings about the removal of the following four ini settings:
  </p>

  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     <code class="parameter">session.entropy_file</code>
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <code class="parameter">session.entropy_length</code>
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <code class="parameter">session.hash_function</code>
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <code class="parameter">session.hash_bits_per_character</code>
    </span>
   </li>
  </ul>

  <p class="para">
   And the addition of the following two ini settings:
  </p>

  <ul class="itemizedlist">
   <li class="listitem">
    <span class="simpara">
     <code class="parameter">session.sid_length</code> - defines the length of the
     session ID, defaulting to 32 characters for backwards compatibility)
    </span>
   </li>
   <li class="listitem">
    <span class="simpara">
     <code class="parameter">session.sid_bits_per_character</code> - defines the number
     of bits to be stored per character (i.e. increases the range of characters
     that can be used in the session ID), defaulting to 4 for backwards
     compatibility
    </span>
   </li>
  </ul>
 </div>

 <div class="sect2" id="migration71.other-changes.ini-file-handling">
  <h3 class="title">Changes to INI file handling</h3>
  <dl>
   
    <dt><code class="parameter">precision</code></dt>
    <dd>
     <p class="para">
       If the value is set to -1, then the dtoa mode 0 is used. The default
       value is still 14.
     </p>
    </dd>
   
   
    <dt><code class="parameter">serialize_precision</code></dt>
    <dd>
     <p class="para">
       If the value is set to -1, then the dtoa mode 0 is used. The value -1 is
       now used by default.
     </p>
    </dd>
   
   
    <dt><code class="parameter">gd.jpeg_ignore_warning</code></dt>
    <dd>
     <p class="para">
       The default of this <var class="filename">php.ini</var> setting has been changed to 1, so by
       default libjpeg warnings are ignored.
     </p>
    </dd>
   
   
    <dt><code class="parameter">opcache.enable_cli</code></dt>
    <dd>
     <p class="para">
       The default of this <var class="filename">php.ini</var> setting has been changed to 1
       (enabled) in PHP 7.1.2, and back to 0 (disabled) in PHP 7.1.7.
     </p>
    </dd>
   
  </dl>
 </div>

 <div class="sect2" id="migration71.other-changes.session-id-csprng-gen">
  <h3 class="title">Session ID generation with a CSPRNG only</h3>

  <p class="para">
   Session IDs will now only be generated with a CSPRNG.
  </p>
 </div>

 <div class="sect2" id="migration71.other-changes.typeerror-error-messages">
  <h3 class="title">More informative <span class="classname"><a href="class.typeerror.php" class="classname">TypeError</a></span> messages when <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> is allowed</h3>
  <p class="para">
   <span class="classname"><a href="class.typeerror.php" class="classname">TypeError</a></span> exceptions for arg_info type checks will
   now provide more informative error messages. If the parameter type or return
   type accepts <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> (by either having a default value of <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> or being a
   nullable type), then the error message will now mention this with a message
   of &quot;must be ... or null&quot; or &quot;must ... or be null.&quot;
  </p>
 </div>
</div><?php manual_footer($setup); ?>