<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/migration80.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'migration80.new-features.php',
    1 => 'New Features',
    2 => 'New Features',
  ),
  'up' => 
  array (
    0 => 'migration80.php',
    1 => 'Migrating from PHP 7.4.x to PHP 8.0.x',
  ),
  'prev' => 
  array (
    0 => 'migration80.php',
    1 => 'Migrating from PHP 7.4.x to PHP 8.0.x',
  ),
  'next' => 
  array (
    0 => 'migration80.new-classes.php',
    1 => 'New Classes and Interfaces',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'appendices/migration80/new-features.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="migration80.new-features" class="sect1">
 <h2 class="title">New Features</h2>

 <div class="sect2" id="migration80.new-features.core">
  <h3 class="title">PHP Core</h3>

  <div class="sect3" id="migration80.new-features.core.named-arguments">
   <h4 class="title">Named Arguments</h4>

   <p class="para">
    
    Support for <a href="functions.arguments.php#functions.named-arguments" class="link">Named Arguments</a> has been added.
   </p>
  </div>

  <div class="sect3" id="migration80.new-features.core.attributes">
   <h4 class="title">Attributes</h4>

   <p class="para">
    Support for <a href="language.attributes.php" class="link">Attributes</a> has been added.
    
    
    
    
   </p>
  </div>

  <div class="sect3" id="migration80.new-features.core.property-promotion">
   <h4 class="title">Constructor Property Promotion</h4>

   <p class="para">
    Support for <a href="language.oop5.decon.php#language.oop5.decon.constructor.promotion" class="link">constructor property promotion</a> (declaring properties in the constructor signature)
    has been added.
    
   </p>
  </div>

  <div class="sect3" id="migration80.new-features.core.union-types">
   <h4 class="title">Union Types</h4>

   <p class="para">
    Support for <a href="language.types.declarations.php#language.types.declarations.composite.union" class="link">union types</a> has been added.
    
   </p> 
  </div>

  <div class="sect3" id="migration80.new-features.core.match">
   <h4 class="title">Match Expression</h4>

   <p class="para">
    Support for <a href="control-structures.match.php" class="link"><code class="literal">match</code> expressions</a> has been added.
    
   </p>
  </div>

  <div class="sect3" id="migration80.new-features.core.nullsafe-operator">
   <h4 class="title">Nullsafe Operator</h4>

   <p class="para">
    Support for the <a href="language.oop5.basic.php#language.oop5.basic.nullsafe" class="link">nullsafe operator</a> (<code class="literal">?-&gt;</code>) has been added.
    
   </p>
  </div>

  <div class="sect3" id="migration80.new-features.core.others">
   <h4 class="title">Other new Features</h4>

   <ul class="itemizedlist">
    <li class="listitem">
     <p class="para">
      The <a href="class.weakmap.php" class="link">WeakMap</a> class has been added.
      
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      The <span class="classname"><a href="class.valueerror.php" class="classname">ValueError</a></span> class has been added.
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      Any number of function parameters may now be replaced by a variadic argument, as long as the
      types are compatible. For example, the following code is now allowed:
     </p>
     <p class="para">
      <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">A </span><span style="color: #007700">{<br />     public function </span><span style="color: #0000BB">method</span><span style="color: #007700">(</span><span style="color: #0000BB">int $many</span><span style="color: #007700">, </span><span style="color: #0000BB">string $parameters</span><span style="color: #007700">, </span><span style="color: #0000BB">$here</span><span style="color: #007700">) {}<br />}<br />class </span><span style="color: #0000BB">B </span><span style="color: #007700">extends </span><span style="color: #0000BB">A </span><span style="color: #007700">{<br />     public function </span><span style="color: #0000BB">method</span><span style="color: #007700">(...</span><span style="color: #0000BB">$everything</span><span style="color: #007700">) {}<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
      </div>

     </p>
    </li>
    <li class="listitem">
     <p class="para">
      <span class="type">static</span> (as in &quot;late static binding&quot;) can now be used as a return type:
     </p>
     <p class="para">
      <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">Test </span><span style="color: #007700">{<br />     public function </span><span style="color: #0000BB">create</span><span style="color: #007700">(): static {<br />          return new static();<br />     }<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
      </div>

      
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      It is now possible to fetch the class name of an object using
      <code class="code">$object::class</code>. The result is the same as <code class="code">get_class($object)</code>.
      
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      <a href="language.oop5.basic.php#language.oop5.basic.new" class="link"><code class="literal">new</code></a> and <a href="language.operators.type.php" class="link"><code class="literal">instanceof</code></a> can now be used with arbitrary expressions,
      using <code class="code">new (expression)(...$args)</code> and <code class="code">$obj instanceof (expression)</code>.
      
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      Some consistency fixes to variable syntax have been applied, for example writing
      <code class="code">Foo::BAR::$baz</code> is now allowed.
      
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      Added <span class="interfacename"><a href="class.stringable.php" class="interfacename">Stringable</a></span> interface, which is automatically implemented if
      a class defines a <a href="language.oop5.magic.php#object.tostring" class="link">__toString()</a> method.
      
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      Traits can now define abstract private methods.
      Such methods must be implemented by the class using the trait.
      
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      <code class="literal">throw</code> can now be used as an expression.
      That allows usages like:
      <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$fn </span><span style="color: #007700">= fn() =&gt; throw new </span><span style="color: #0000BB">Exception</span><span style="color: #007700">(</span><span style="color: #DD0000">'Exception in arrow function'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$user </span><span style="color: #007700">= </span><span style="color: #0000BB">$session</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">user </span><span style="color: #007700">?? throw new </span><span style="color: #0000BB">Exception</span><span style="color: #007700">(</span><span style="color: #DD0000">'Must have user'</span><span style="color: #007700">);</span></span></code></div>
      </div>

      
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      An optional trailing comma is now allowed in parameter lists.
      <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">function </span><span style="color: #0000BB">functionWithLongSignature</span><span style="color: #007700">(<br />    </span><span style="color: #0000BB">Type1 $parameter1</span><span style="color: #007700">,<br />    </span><span style="color: #0000BB">Type2 $parameter2</span><span style="color: #007700">, </span><span style="color: #FF8000">// &lt;-- This comma is now allowed.<br /></span><span style="color: #007700">) {<br />}</span></span></code></div>
      </div>

      
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      It is now possible to write <code class="code">catch (Exception)</code> to catch an exception without storing
      it in a variable.
      
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      Support for <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> type has been added.
      
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      Private methods declared on a parent class no longer enforce any inheritance rules on the methods
      of a child class (with the exception of final private constructors).
      The following example illustrates which restrictions have been removed:
      <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">ParentClass </span><span style="color: #007700">{<br />    private function </span><span style="color: #0000BB">method1</span><span style="color: #007700">() {}<br />    private function </span><span style="color: #0000BB">method2</span><span style="color: #007700">() {}<br />    private static function </span><span style="color: #0000BB">method3</span><span style="color: #007700">() {}<br />    </span><span style="color: #FF8000">// Throws a warning, as "final" no longer has an effect:<br />    </span><span style="color: #007700">private final function </span><span style="color: #0000BB">method4</span><span style="color: #007700">() {}<br />}<br />class </span><span style="color: #0000BB">ChildClass </span><span style="color: #007700">extends </span><span style="color: #0000BB">ParentClass </span><span style="color: #007700">{<br />    </span><span style="color: #FF8000">// All of the following are now allowed, even though the modifiers aren't<br />    // the same as for the private methods in the parent class.<br />    </span><span style="color: #007700">public abstract function </span><span style="color: #0000BB">method1</span><span style="color: #007700">() {}<br />    public static function </span><span style="color: #0000BB">method2</span><span style="color: #007700">() {}<br />    public function </span><span style="color: #0000BB">method3</span><span style="color: #007700">() {}<br />    public function </span><span style="color: #0000BB">method4</span><span style="color: #007700">() {}<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
      </div>

      
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      <span class="function"><a href="function.get-resource-id.php" class="function">get_resource_id()</a></span> has been added, which returns the same value as
      <code class="code">(int) $resource</code>. It provides the same functionality under a clearer API.
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      The <span class="classname"><a href="class.internaliterator.php" class="classname">InternalIterator</a></span> has been added.
     </p>
    </li>
   </ul>
  </div>
 </div>

 <div class="sect2" id="migration80.new-features.date">
  <h3 class="title">Date and Time</h3>
  
  <ul class="itemizedlist">
   <li class="listitem">
    <p class="para">
     <span class="methodname"><a href="datetime.createfrominterface.php" class="methodname">DateTime::createFromInterface()</a></span> and
     <span class="methodname"><a href="datetimeimmutable.createfrominterface.php" class="methodname">DateTimeImmutable::createFromInterface()</a></span> have been added.
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     The DateTime format specifier <code class="literal">p</code> has been added, which is the same as
     <code class="literal">P</code> but returns <code class="literal">Z</code> rather than <code class="literal">+00:00</code>
     for UTC.
    </p>
   </li>
  </ul>
 </div>

 <div class="sect2" id="migration80.new-features.dom">
  <h3 class="title">DOM</h3>

  <p class="para">
   <span class="interfacename"><a href="class.domparentnode.php" class="interfacename">DOMParentNode</a></span> and <span class="interfacename"><a href="class.domchildnode.php" class="interfacename">DOMChildNode</a></span> with
   new traversal and manipulation APIs have been added.
   
  </p>
 </div>

 <div class="sect2" id="migration80.new-features.filter">
  <h3 class="title">Filter</h3>

  <p class="para">
   <strong><code><a href="filter.constants.php#constant.filter-validate-bool">FILTER_VALIDATE_BOOL</a></code></strong> has been added as an alias for
   <strong><code><a href="filter.constants.php#constant.filter-validate-boolean">FILTER_VALIDATE_BOOLEAN</a></code></strong>. The new name is preferred, as it uses the canonical
   type name.
  </p>
 </div>

 <div class="sect2" id="migration80.new-features.enchant">
  <h3 class="title">Enchant</h3>

  <p class="para">
   <span class="function"><a href="function.enchant-dict-add.php" class="function">enchant_dict_add()</a></span>, <span class="function"><a href="function.enchant-dict-is-added.php" class="function">enchant_dict_is_added()</a></span>, and
   <strong><code><a href="enchant.constants.php#constant.libenchant-version">LIBENCHANT_VERSION</a></code></strong> have been added.
  </p>
 </div>

 <div class="sect2" id="migration80.new-features.fpm">
  <h3 class="title">FPM</h3>

  <p class="para">
   Added a new option <code class="literal">pm.status_listen</code> that allows getting the status from
   different endpoint (e.g. port or UDS file) which is useful for getting the status when all
   children are busy with serving long running requests.
  </p>
 </div>

 <div class="sect2" id="migration80.new-features.hash">
  <h3 class="title">Hash</h3>

  <p class="para">
   <span class="classname"><a href="class.hashcontext.php" class="classname">HashContext</a></span> objects can now be serialized.
  </p>
 </div>

 <div class="sect2" id="migration80.new-features.intl">
  <h3 class="title">Internationalization Functions</h3>

  <p class="para">
   The <strong><code><a href="class.intldateformatter.php#intldateformatter.constants.relative-full">IntlDateFormatter::RELATIVE_FULL</a></code></strong>,
   <strong><code><a href="class.intldateformatter.php#intldateformatter.constants.relative-long">IntlDateFormatter::RELATIVE_LONG</a></code></strong>,
   <strong><code><a href="class.intldateformatter.php#intldateformatter.constants.relative-medium">IntlDateFormatter::RELATIVE_MEDIUM</a></code></strong>, and
   <strong><code><a href="class.intldateformatter.php#intldateformatter.constants.relative-short">IntlDateFormatter::RELATIVE_SHORT</a></code></strong>
   constants have been added.
  </p>
 </div>

 <div class="sect2" id="migration80.new-features.ldap">
  <h3 class="title">LDAP</h3>

  <p class="para">
   <span class="function"><a href="function.ldap-count-references.php" class="function">ldap_count_references()</a></span> has been added, which returns the number
   of reference messages in a search result.
  </p>
 </div>
 <div class="sect2" id="migration80.new-features.opcache">
  <h3 class="title">OPcache</h3>

  <p class="para">
   If the opcache.record_warnings ini setting is
   enabled, OPcache will record compile-time warnings and replay them on the next include, even if
   it is served from cache.
  </p>
 </div>

 <div class="sect2" id="migration80.new-features.openssl">
  <h3 class="title">OpenSSL</h3>

  <p class="para">
   Added Cryptographic Message Syntax (CMS) (<a href="https://datatracker.ietf.org/doc/html/rfc5652" class="link external">&raquo;&nbsp;RFC 5652</a>)
   support composed of functions for encryption, decryption, signing, verifying and reading. The API
   is similar to the API for <abbr title="Public Key Cryptography Standards">PKCS</abbr> #7 functions with an addition of new encoding constants:
   <strong><code><a href="openssl.constants.other.php#constant.openssl-encoding-der">OPENSSL_ENCODING_DER</a></code></strong>, <strong><code><a href="openssl.constants.other.php#constant.openssl-encoding-smime">OPENSSL_ENCODING_SMIME</a></code></strong>
   and <strong><code><a href="openssl.constants.other.php#constant.openssl-encoding-pem">OPENSSL_ENCODING_PEM</a></code></strong>:
   <ul class="simplelist">
    <li>
     <span class="function"><a href="function.openssl-cms-encrypt.php" class="function">openssl_cms_encrypt()</a></span> encrypts the message in the file with the certificates
     and outputs the result to the supplied file.
    </li>
    <li>
     <span class="function"><a href="function.openssl-cms-decrypt.php" class="function">openssl_cms_decrypt()</a></span> that decrypts the S/MIME message in the file and outputs
     the results to the supplied file.
    </li>
    <li>
     <span class="function"><a href="function.openssl-cms-read.php" class="function">openssl_cms_read()</a></span> that exports the CMS file to an array
     of <abbr title="Privacy-Enhanced Mail">PEM</abbr> certificates.
    </li>
    <li>
     <span class="function"><a href="function.openssl-cms-sign.php" class="function">openssl_cms_sign()</a></span> that signs the MIME message in the file with a cert and key
     and output the result to the supplied file.
    </li>
    <li>
     <span class="function"><a href="function.openssl-cms-verify.php" class="function">openssl_cms_verify()</a></span> that verifies that the data block is intact, the signer
     is who they say they are, and returns the certs of the signers.
    </li>
   </ul>
  </p>
 </div>

 <div class="sect2" id="migration80.new-features.pcre">
  <h3 class="title">Regular Expressions (Perl-Compatible)</h3>

  <p class="para">
   <span class="function"><a href="function.preg-last-error-msg.php" class="function">preg_last_error_msg()</a></span> has been added, which returns a human-readable message for the last
   PCRE error. It complements <span class="function"><a href="function.preg-last-error.php" class="function">preg_last_error()</a></span>, which returns an integer enum value
   instead.
  </p>
 </div>

 <div class="sect2" id="migration80.new-features.reflection">
  <h3 class="title">Reflection</h3>

  <ul class="itemizedlist">
   <li class="listitem">
    <p class="para">
     The following methods can now return information about default values of
     parameters of internal functions:
    </p>
    <p class="para">
     <ul class="simplelist">
      <li><span class="methodname"><a href="reflectionparameter.isdefaultvalueavailable.php" class="methodname">ReflectionParameter::isDefaultValueAvailable()</a></span></li>
      <li><span class="methodname"><a href="reflectionparameter.getdefaultvalue.php" class="methodname">ReflectionParameter::getDefaultValue()</a></span></li>
      <li><span class="methodname"><a href="reflectionparameter.isdefaultvalueconstant.php" class="methodname">ReflectionParameter::isDefaultValueConstant()</a></span></li>
      <li><span class="methodname"><a href="reflectionparameter.getdefaultvalueconstantname.php" class="methodname">ReflectionParameter::getDefaultValueConstantName()</a></span></li>
     </ul>
    </p>
   </li>
  </ul>
 </div>

 <div class="sect2" id="migration80.new-features.sqlite3">
  <h3 class="title">SQLite3</h3>

  <p class="para">
   <span class="methodname"><a href="sqlite3.setauthorizer.php" class="methodname">SQLite3::setAuthorizer()</a></span> and respective class constants have been added
   to set a userland callback that will be used to authorize or not an action on the database.
   
  </p>
 </div>

 <div class="sect2" id="migration80.new-features.standard">
  <h3 class="title">Standard Library</h3>

  <ul class="itemizedlist">
   <li class="listitem">
    <p class="para">
     <span class="function"><a href="function.str-contains.php" class="function">str_contains()</a></span>, <span class="function"><a href="function.str-starts-with.php" class="function">str_starts_with()</a></span> and
     <span class="function"><a href="function.str-ends-with.php" class="function">str_ends_with()</a></span> have been added, which check whether <code class="parameter">haystack</code> contains,
     starts with or ends with <code class="parameter">needle</code>, respectively.
     
     
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     <span class="function"><a href="function.fdiv.php" class="function">fdiv()</a></span> has been added, which performs a floating-point division under IEEE 754 semantics.
     Division by zero is considered well-defined and will return one of <code class="literal">Inf</code>,
     <code class="literal">-Inf</code> or <code class="literal">NaN</code>.
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     <span class="function"><a href="function.get-debug-type.php" class="function">get_debug_type()</a></span> has been added, which returns a type useful for error messages. Unlike
     <span class="function"><a href="function.gettype.php" class="function">gettype()</a></span>, it uses canonical type names, returns class names for objects, and
     indicates the resource type for resources.
     
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     <span class="function"><a href="function.printf.php" class="function">printf()</a></span> and friends now support the <code class="literal">%h</code> and
     <code class="literal">%H</code> format specifiers. These are the same as <code class="literal">%g</code> and
     <code class="literal">%G</code>, but always use <code class="literal">&quot;.&quot;</code> as the decimal separator, rather
     than determining it through the <strong><code><a href="string.constants.php#constant.lc-numeric">LC_NUMERIC</a></code></strong> locale.
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     <span class="function"><a href="function.printf.php" class="function">printf()</a></span> and friends now support using <code class="literal">&quot;*&quot;</code> as width or
     precision, in which case the width/precision is passed as an argument to printf. This also allows
     using precision <code class="literal">-1</code> with <code class="literal">%g</code>, <code class="literal">%G</code>,
     <code class="literal">%h</code> and <code class="literal">%H</code>. For example, the following code can be used to
     reproduce PHP&#039;s default floating point formatting:
    </p>
    <p class="para">
     <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"%.*H"</span><span style="color: #007700">, (int) </span><span style="color: #0000BB">ini_get</span><span style="color: #007700">(</span><span style="color: #DD0000">"precision"</span><span style="color: #007700">), </span><span style="color: #0000BB">$float</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">"%.*H"</span><span style="color: #007700">, (int) </span><span style="color: #0000BB">ini_get</span><span style="color: #007700">(</span><span style="color: #DD0000">"serialize_precision"</span><span style="color: #007700">), </span><span style="color: #0000BB">$float</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
     </div>

    </p>
   </li>
   <li class="listitem">
    <p class="para">
     <span class="function"><a href="function.proc-open.php" class="function">proc_open()</a></span> now supports pseudo-terminal (PTY) descriptors. The following
     attaches <code class="literal">stdin</code>, <code class="literal">stdout</code> and <code class="literal">stderr</code> to the
     same PTY:
    </p>
    <p class="para">
     <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$proc </span><span style="color: #007700">= </span><span style="color: #0000BB">proc_open</span><span style="color: #007700">(</span><span style="color: #0000BB">$command</span><span style="color: #007700">, [[</span><span style="color: #DD0000">'pty'</span><span style="color: #007700">], [</span><span style="color: #DD0000">'pty'</span><span style="color: #007700">], [</span><span style="color: #DD0000">'pty'</span><span style="color: #007700">]], </span><span style="color: #0000BB">$pipes</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
     </div>

    </p>
   </li>
   <li class="listitem">
    <p class="para">
     <span class="function"><a href="function.proc-open.php" class="function">proc_open()</a></span> now supports socket pair descriptors. The following attaches a
     distinct socket pair to <code class="literal">stdin</code>, <code class="literal">stdout</code> and
     <code class="literal">stderr</code>:
    </p>
    <p class="para">
     <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$proc </span><span style="color: #007700">= </span><span style="color: #0000BB">proc_open</span><span style="color: #007700">(</span><span style="color: #0000BB">$command</span><span style="color: #007700">, [[</span><span style="color: #DD0000">'socket'</span><span style="color: #007700">], [</span><span style="color: #DD0000">'socket'</span><span style="color: #007700">], [</span><span style="color: #DD0000">'socket'</span><span style="color: #007700">]], </span><span style="color: #0000BB">$pipes</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
     </div>

    </p>
    <p class="para">
     Unlike pipes, sockets do not suffer from blocking I/O issues on Windows. However, not all
     programs may work correctly with stdio sockets.
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     Sorting functions are now stable, which means that equal-comparing elements will retain their
     original order.
     
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     <span class="function"><a href="function.array-diff.php" class="function">array_diff()</a></span>, <span class="function"><a href="function.array-intersect.php" class="function">array_intersect()</a></span> and their variations can
     now be used with a single array as argument. This means that usages like the following are now
     possible:
    </p>
    <p class="para">
     <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">// OK even if $excludes is empty:<br /></span><span style="color: #0000BB">array_diff</span><span style="color: #007700">(</span><span style="color: #0000BB">$array</span><span style="color: #007700">, ...</span><span style="color: #0000BB">$excludes</span><span style="color: #007700">);<br /></span><span style="color: #FF8000">// OK even if $arrays only contains a single array:<br /></span><span style="color: #0000BB">array_intersect</span><span style="color: #007700">(...</span><span style="color: #0000BB">$arrays</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
     </div>

    </p>
   </li>
   <li class="listitem">
    <p class="para">
     The <code class="parameter">flag</code> parameter of <span class="function"><a href="function.ob-implicit-flush.php" class="function">ob_implicit_flush()</a></span> was changed
     to accept a <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span> rather than an <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>.
    </p>
   </li>
  </ul>
 </div>

 <div class="sect2" id="migration80.new-features.tokenizer">
  <h3 class="title">Tokenizer</h3>

  <p class="para">
   <span class="classname"><a href="class.phptoken.php" class="classname">PhpToken</a></span> adds an object-based interface to the tokenizer. It provides a
   more uniform and ergonomic representation, while being more memory efficient and faster.
   
  </p>
 </div>

 <div class="sect2" id="migration80.new-features.zip">
  <h3 class="title">Zip</h3>

  <ul class="itemizedlist">
   <li class="listitem">
    <p class="para">
     The Zip extension has been updated to version 1.19.1.
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     New <span class="methodname"><a href="ziparchive.setmtimename.php" class="methodname">ZipArchive::setMtimeName()</a></span> and
     <span class="methodname"><a href="ziparchive.setmtimeindex.php" class="methodname">ZipArchive::setMtimeIndex()</a></span> to set the modification time of an entry.
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     New <span class="methodname"><a href="ziparchive.registerprogresscallback.php" class="methodname">ZipArchive::registerProgressCallback()</a></span> to provide updates during archive close.
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     New <span class="methodname"><a href="ziparchive.registercancelcallback.php" class="methodname">ZipArchive::registerCancelCallback()</a></span> to allow cancellation during archive
     close.
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     New <span class="methodname"><a href="ziparchive.replacefile.php" class="methodname">ZipArchive::replaceFile()</a></span> to replace an entry content.
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     New <span class="methodname"><a href="ziparchive.iscompressionmethoddupported.php" class="methodname">ZipArchive::isCompressionMethodSupported()</a></span> to check optional compression
     features.
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     New <span class="methodname"><a href="ziparchive.isencryptionmethoddupported.php" class="methodname">ZipArchive::isEncryptionMethodSupported()</a></span> to check optional encryption
     features.
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     The <var class="varname">ZipArchive::lastId</var> property to get the index value of
     the last added entry has been added.
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     Errors can now be checked after an archive has been closed using the
     <var class="varname">ZipArchive::status</var> and
     <var class="varname">ZipArchive::statusSys</var> properties, or the
     <span class="methodname"><a href="ziparchive.getstatusstring.php" class="methodname">ZipArchive::getStatusString()</a></span> method.
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     The <code class="literal">&#039;remove_path&#039;</code> option of <span class="methodname"><a href="ziparchive.addglob.php" class="methodname">ZipArchive::addGlob()</a></span> and
     <span class="methodname"><a href="ziparchive.addpattern.php" class="methodname">ZipArchive::addPattern()</a></span> is now treated as an arbitrary string prefix (for
     consistency with the <code class="literal">&#039;add_path&#039;</code> option), whereas formerly it was treated as a
     directory name.
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     Optional compression / encryption features are now listed in phpinfo.
    </p>
   </li>
  </ul>
 </div>

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