php-doc-en/appendices/migration73/new-features.xml
Christoph Michael Becker 216c1d34f9 Fix markup and typo
git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@346396 c90b9560-bf6c-de11-be94-00142212c4b1
2018-12-18 23:50:47 +00:00

350 lines
11 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<sect1 xml:id="migration73.new-features" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>New Features</title>
<sect2 xml:id="migration73.new-features.core">
<title>PHP Core</title>
<sect3 xml:id="migration73.new-features.core.heredoc">
<title>More Flexible Heredoc and Nowdoc Syntax</title>
<para>
The closing marker for doc strings is no longer required to be followed by a
semicolon or newline. Additionally the closing marker may be indented, in
which case the indentation will be stripped from all lines in the doc string.
</para>
</sect3>
<sect3 xml:id="migration73.new-features.core.destruct-reference">
<title>Array Destructuring supports Reference Assignments</title>
<para>
Array destructuring now supports reference assignments using the syntax
<literal>[&amp;$a, [$b, &amp;$c]] = $d</literal>. The same is also supported
for <function>list</function>.
</para>
</sect3>
<sect3 xml:id="migration73.new-features.core.instanceof-literals">
<title>Instanceof Operator accepts Literals</title>
<para>
<literal>instanceof</literal> now allows literals as the first operand, in
which case the result is always &false;.
</para>
</sect3>
<sect3 xml:id="migration73.new-features.core.compileerror">
<title>CompileError Exception instead of some Compilation Errors</title>
<para>
A new <classname>CompileError</classname> exception has been added, from
which <classname>ParseError</classname> inherits. A small number of
compilation errors will now throw a <classname>CompileError</classname>
instead of generating a fatal error. Currently this only affects compilation
errors that may be thrown by <function>token_get_all</function> in
<constant>TOKEN_PARSE</constant> mode, but more errors may be converted in
the future.
</para>
</sect3>
<sect3 xml:id="migration73.new-features.core.trailing-commas">
<title>Trailing Commas are allowed in Calls</title>
<para>
Trailing commas in function and method calls are now allowed.
</para>
</sect3>
<sect3 xml:id="migration73.new-features.core.argon2id">
<title>Argon2id Support</title>
<para>
The <option role="configure">--with-password-argon2[=dir]</option> configure
argument now provides support for both Argon2i and Argon2id hashes in the
<function>password_hash</function>, <function>password_verify</function>,
<function>password_get_info</function>, and
<function>password_needs_rehash</function> functions. Passwords may be hashed
and verified using the <constant>PASSWORD_ARGON2ID</constant> constant.
Support for both Argon2i and Argon2id in the <function>password_*</function>
functions now requires PHP be linked against libargon2 reference library ≥
20161029.
</para>
</sect3>
</sect2>
<sect2 xml:id="migration73.new-features.fpm">
<title>FastCGI Process Manager</title>
<para>
New options have been added to customize the FPM logging:
<variablelist>
<varlistentry>
<term><literal>log_limit</literal></term>
<listitem>
<simpara>
This global option can be used for setting the log limit for the logged
line which allows to log messages longer than 1024 characters without
wrapping. It also fixes various wrapping issues.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>log_buffering</literal></term>
<listitem>
<simpara>
This global option allows an experimental logging without extra buffering.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><literal>decorate_workers_output</literal></term>
<listitem>
<simpara>
This pool option allows to disable the output decoration for workers
output when <literal>catch_workers_output</literal> is enabled.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</para>
</sect2>
<sect2 xml:id="migration73.new-features.bc">
<title>BC Math Functions</title>
<para>
<function>bcscale</function> can now also be used as getter to retrieve the
current scale in use.
</para>
</sect2>
<sect2 xml:id="migration73.new-features.ldap">
<title>Lightweight Directory Access Protocol</title>
<para>
Full support for LDAP Controls has been added to the <link
linkend="book.ldap">LDAP</link> querying functions and
<function>ldap_parse_result</function>:
<itemizedlist>
<listitem>
<simpara>
A <literal>$serverctrls</literal> parameter to send controls to the
server in <function>ldap_add</function>,
<function>ldap_mod_replace</function>, <function>ldap_mod_add</function>,
<function>ldap_mod_del</function>, <function>ldap_rename</function>,
<function>ldap_compare</function>, <function>ldap_delete</function>,
<function>ldap_modify_batch</function>,
<function>ldap_search</function>, <function>ldap_list</function> and
<function>ldap_read</function> has been added.
</simpara>
</listitem>
<listitem>
<simpara>
The out parameter <literal>$serverctrls</literal> to get controls from the server in
<function>ldap_parse_result</function> has been added.
</simpara>
</listitem>
<listitem>
<simpara>
Support for <constant>LDAP_OPT_SERVER_CONTROLS</constant> and
<constant>LDAP_OPT_CLIENT_CONTROLS</constant> in
<function>ldap_get_option</function> and
<function>ldap_set_option</function> has been fixed.
</simpara>
</listitem>
</itemizedlist>
</para>
</sect2>
<sect2 xml:id="migration73.new-features.mbstring">
<title>Multibyte String Functions</title>
<sect3 xml:id="migration73.new-features.mbstring.case-mapping-folding">
<title>Full Case-Mapping and Case-Folding Support</title>
<para>
Support for full case-mapping and case-folding has been added. Unlike simple
case-mapping, full case-mapping may change the length of the string. For
example:
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
mb_strtoupper("Straße");
// Produces STRAßE on PHP 7.2
// Produces STRASSE on PHP 7.3
?>
]]>
</programlisting>
</informalexample>
The different casing mapping and folding modes are available through
<function>mb_convert_case</function>:
<itemizedlist>
<listitem>
<simpara>
<constant>MB_CASE_LOWER</constant> (used by <function>mb_strtolower</function>)
</simpara>
</listitem>
<listitem>
<simpara>
<constant>MB_CASE_UPPER</constant> (used by <function>mb_strtoupper</function>)
</simpara>
</listitem>
<listitem>
<simpara>
<constant>MB_CASE_TITLE</constant>
</simpara>
</listitem>
<listitem>
<simpara>
<constant>MB_CASE_FOLD</constant>
</simpara>
</listitem>
<listitem>
<simpara>
<constant>MB_CASE_LOWER_SIMPLE</constant>
</simpara>
</listitem>
<listitem>
<simpara>
<constant>MB_CASE_UPPER_SIMPLE</constant>
</simpara>
</listitem>
<listitem>
<simpara>
<constant>MB_CASE_TITLE_SIMPLE</constant>
</simpara>
</listitem>
<listitem>
<simpara>
<constant>MB_CASE_FOLD_SIMPLE</constant> (used by case-insensitive operations)
</simpara>
</listitem>
</itemizedlist>
Only unconditional, language agnostic full case-mapping is performed.
</para>
</sect3>
<sect3 xml:id="migration73.new-features.mbstring.case-insensitive-ops">
<title>Case-Insensitive String Operations use Case-Folding</title>
<para>
Case-insensitive string operations now use case-folding instead of case-
mapping during comparisons. This means that more characters will be
considered (case insensitively) equal now.
</para>
</sect3>
<sect3 xml:id="migration73.new-features.mbstring.mb-case-title">
<title>MB_CASE_TITLE performs Title-Case Conversion</title>
<para>
<function>mb_convert_case</function> with <constant>MB_CASE_TITLE</constant>
now performs title-case conversion based on the Cased and CaseIgnorable
derived Unicode properties. In particular this also improves handling of
quotes and apostrophes.
</para>
</sect3>
<sect3 xml:id="migration73.new-features.mbstring.ucd11">
<title>Unicode 11 Support</title>
<para>
The <link linkend="book.mbstring">Multibyte String</link> data tables have
been updated for Unicode 11.
</para>
</sect3>
<sect3 xml:id="migration73.new-features.mbstring.long-strings">
<title>Long String Support</title>
<para>
The <link linkend="ref.mbstring">Multibyte String Functions</link> now
correctly support strings larger than 2GB.
</para>
</sect3>
<sect3 xml:id="migration73.new-features.mbstring.performance">
<title>Performance Improvements</title>
<para>
Performance of the <link linkend="book.mbstring">Multibyte String</link>
extension has been significantly improved across the board. The largest
improvements are in case conversion functions.
</para>
</sect3>
<sect3 xml:id="migration73.new-features.mbstring.named-captures">
<title>Named Captures Support</title>
<para>
The <literal>mb_ereg_*</literal> functions now support named captures.
Matching functions like <function>mb_ereg</function> will now return named
captures both using their group number and their name, similar to PCRE:
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
mb_ereg('(?<word>\w+)', '国', $matches);
// => [0 => "国", 1 => "国", "word" => "国"];
?>
]]>
</programlisting>
</informalexample>
Additionally, <function>mb_ereg_replace</function> now supports the
<code>\k&lt;&gt;</code> and <code>\k''</code> notations to reference named
captures in the replacement string:
<informalexample>
<programlisting role="php">
<![CDATA[
<?php
mb_ereg_replace('\s*(?<word>\w+)\s*', "_\k<word>_\k'word'_", ' foo ');
// => "_foo_foo_"
?>
]]>
</programlisting>
</informalexample>
<code>\k&lt;&gt;</code> and <code>\k''</code> can also be used for numbered
references, which also works with group numbers greater than 9.
</para>
</sect3>
</sect2>
<sect2 xml:id="migration73.new-features.realine">
<title>Readline</title>
<para>
Support for the <literal>completion_append_character</literal> and
<literal>completion_suppress_append</literal> options has been added to
<function>readline_info</function>. These options are only available if PHP
is linked against libreadline (rather than libedit).
</para>
</sect2>
</sect1>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->