1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350
|
<?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>[&$a, [$b, &$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>$controls</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>$controls</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<></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<></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
-->
|