mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-15 08:28:54 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@343545 c90b9560-bf6c-de11-be94-00142212c4b1
469 lines
11 KiB
XML
469 lines
11 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
|
|
<sect1 xml:id="migration72.new-features" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<title>New features</title>
|
|
|
|
<sect2 xml:id="migration72.new-features.object-type">
|
|
<title>New object type</title>
|
|
|
|
<para>
|
|
A new type, <type>object</type>, has been introduced that can be used for
|
|
(contravariant) parameter typing and (covariant) return typing of any
|
|
objects.
|
|
</para>
|
|
|
|
<informalexample>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
function test(object $obj) : object
|
|
{
|
|
return new SplQueue();
|
|
}
|
|
|
|
test(new StdClass());
|
|
]]>
|
|
</programlisting>
|
|
</informalexample>
|
|
</sect2>
|
|
|
|
<sect2 xml:id="migration72.new-features.ext-loading-by-name">
|
|
<title>Extension loading by name</title>
|
|
|
|
<para>
|
|
Shared extensions no longer require their file extension
|
|
(<literal>.so</literal> for Unix or <literal>.dll</literal> for Windows) to
|
|
be specified. This is enabled in the php.ini file, as well as in the
|
|
<function>dl</function> function.
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 xml:id="migration72.new-features.abstract-method-overriding">
|
|
<title>Abstract method overriding</title>
|
|
|
|
<para>
|
|
Abstract methods can now be overridden when an abstract class extends
|
|
another abstract class.
|
|
</para>
|
|
|
|
<informalexample>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
abstract class A
|
|
{
|
|
abstract function test(string $s);
|
|
}
|
|
abstract class B extends A
|
|
{
|
|
// overridden - still maintaining contravariance for parameters and covariance for return
|
|
abstract function test($s) : int;
|
|
}
|
|
]]>
|
|
</programlisting>
|
|
</informalexample>
|
|
</sect2>
|
|
|
|
<sect2 xml:id="migration72.new-features.sodium">
|
|
<title><link linkend="book.sodium">Sodium</link> is now a core extension</title>
|
|
|
|
<para>
|
|
The modern Sodium cryptography library has now become a core extension in PHP.
|
|
</para>
|
|
<para>
|
|
For a complete function reference, see the <link linkend="book.sodium">Sodium</link>
|
|
chapter.
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 xml:id="migration72.new-features.pws-hashing-with-argon2">
|
|
<title>Password hashing with Argon2</title>
|
|
|
|
<para>
|
|
Argon2 has been added to the <link linkend="book.password">password hashing API</link>,
|
|
where the following constants have been exposed:
|
|
</para>
|
|
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
<constant>PASSWORD_ARGON2I</constant>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<constant>PASSWORD_ARGON2_DEFAULT_MEMORY_COST</constant>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<constant>PASSWORD_ARGON2_DEFAULT_TIME_COST</constant>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<constant>PASSWORD_ARGON2_DEFAULT_THREADS</constant>
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</sect2>
|
|
|
|
<sect2 xml:id="migration72.new-features.pdo-extended-str-types">
|
|
<title>Extended string types for <link linkend="book.pdo">PDO</link></title>
|
|
|
|
<para>
|
|
PDO's string type has been extended to support the national character type
|
|
when emulating prepares. This has been done with the following constants:
|
|
</para>
|
|
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
<constant>PDO::PARAM_STR_NATL</constant>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<constant>PDO::PARAM_STR_CHAR</constant>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<constant>PDO::ATTR_DEFAULT_STR_PARAM</constant>
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
|
|
<para>
|
|
These constants are utilised by bitwise <literal>OR</literal>'ing them with
|
|
<constant>PDO::PARAM_STR</constant>:
|
|
</para>
|
|
|
|
<informalexample>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$db->quote('über', PDO::PARAM_STR | PDO::PARAM_STR_NATL);
|
|
]]>
|
|
</programlisting>
|
|
</informalexample>
|
|
</sect2>
|
|
|
|
<sect2 xml:id="migration72.new-features.additional-emulated-prepares-debugging-info">
|
|
<title>Additional emulated prepares debugging information for <link linkend="book.pdo">PDO</link></title>
|
|
|
|
<para>
|
|
The <function>PDOStatement::debugDumpParams</function> method has been
|
|
updated to include the SQL being sent to the DB, where the full, raw query
|
|
(including the replaced placeholders with their bounded values) will be
|
|
shown. This has been added to aid with debugging emulated prepares (and so
|
|
it will only be available when emulated prepares are turned on).
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 xml:id="migration72.new-features.extended-ops-in-ldap">
|
|
<title>Support for extended operations in <link linkend="book.ldap">LDAP</link></title>
|
|
|
|
<para>
|
|
Support for EXOP has been added to the LDAP extension. This has been done by
|
|
exposing the following functions and constants:
|
|
</para>
|
|
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
<function>ldap_parse_exop</function>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<function>ldap_exop</function>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<function>ldap_exop_passwd</function>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<function>ldap_exop_whoami</function>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<constant>LDAP_EXOP_START_TLS</constant>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<constant>LDAP_EXOP_MODIFY_PASSWD</constant>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<constant>LDAP_EXOP_REFRESH</constant>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<constant>LDAP_EXOP_WHO_AM_I</constant>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<constant>LDAP_EXOP_TURN</constant>
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</sect2>
|
|
|
|
<sect2 xml:id="migration72.new-features.addr-info-in-sockets">
|
|
<title>Address Information additions to the <link linkend="book.sockets">Sockets</link> extension</title>
|
|
|
|
<para>
|
|
The sockets extension now has the ability to lookup address information, as
|
|
well as connect to it, bind to it, and explain it. The following four
|
|
functions have been added for this:
|
|
</para>
|
|
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
<function>socket_addrinfo_lookup</function>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<function>socket_addrinfo_connect</function>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<function>socket_addrinfo_bind</function>
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
<function>socket_addrinfo_explain</function>
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</sect2>
|
|
|
|
<sect2 xml:id="migration72.new-features.param-type-widening">
|
|
<title>Parameter type widening</title>
|
|
|
|
<para>
|
|
Parameter types from overridden methods and from interface implementations
|
|
may now be omitted. This is still in compliance with LSP, since parameters
|
|
types are contravariant.
|
|
</para>
|
|
|
|
<informalexample>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
interface A
|
|
{
|
|
public function Test(array $input);
|
|
}
|
|
|
|
class B implements A
|
|
{
|
|
public function Test($input){} // type omitted for $input
|
|
}
|
|
]]>
|
|
</programlisting>
|
|
</informalexample>
|
|
</sect2>
|
|
|
|
<sect2 xml:id="migration72.new-features.trailing-comma-in-grouped-namespaces">
|
|
<title>Allow a trailing comma for grouped namespaces</title>
|
|
|
|
<para>
|
|
A trailing comma can now be added to the group-use syntax introduced in
|
|
PHP 7.0.
|
|
</para>
|
|
|
|
<informalexample>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
use Foo\Bar\{
|
|
Foo,
|
|
Bar,
|
|
Baz,
|
|
};
|
|
]]>
|
|
</programlisting>
|
|
</informalexample>
|
|
</sect2>
|
|
|
|
<sect2 xml:id="migration72.new-features.proc_nice-windows-support">
|
|
<title><function>proc_nice</function> support on Windows</title>
|
|
|
|
<para>
|
|
The <function>proc_nice</function> function is now supported on Windows.
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 xml:id="migration72.new-features.pack-unpack-endian-support">
|
|
<title><function>pack</function> and <function>unpack</function> endian support</title>
|
|
|
|
<para>
|
|
The <function>pack</function> and <function>unpack</function> functions now
|
|
support float and double in both little and big endian.
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 xml:id="migration72.new-features.exif-features">
|
|
<title>Enhancements to the <link linkend="book.exif">EXIF</link> extension</title>
|
|
|
|
<para>
|
|
The EXIF extension has been updated to support a much larger range of formats. This
|
|
means that their format specific tags are now properly translated when parsing images
|
|
with the <function>exif_read_data</function> function. The following new formats are
|
|
now supported:
|
|
</para>
|
|
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
Samsung
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
DJI
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Panasonic
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Sony
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Pentax
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Minolta
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Sigma/Foveon
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
AGFA
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Kyocera
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Ricoh
|
|
</simpara>
|
|
</listitem>
|
|
<listitem>
|
|
<simpara>
|
|
Epson
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
|
|
<para>
|
|
The EXIF functions <function>exif_read_data</function> and <function>exif_thumbnail</function>
|
|
now support passing streams as their first argument.
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 xml:id="migration72.new-features.pcre">
|
|
<title>New features in <link linkend="book.pcre">PCRE</link></title>
|
|
|
|
<itemizedlist>
|
|
<listitem>
|
|
<simpara>
|
|
The <literal>J</literal> modifier for setting PCRE_DUPNAMES has been added.
|
|
</simpara>
|
|
</listitem>
|
|
</itemizedlist>
|
|
</sect2>
|
|
|
|
<sect2 xml:id="migration72.new-features.sqlite3">
|
|
<title><link linkend="book.sqlite3">SQLite3</link> allows writing BLOBs</title>
|
|
|
|
<para>
|
|
<methodname>SQLite3::openBlob</methodname> now allows to open BLOB fields in
|
|
write mode; formerly only read mode was supported.
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 xml:id="migration72.new-features.oci8">
|
|
<title><link linkend="book.oci8">Oracle OCI8</link> Transparent Application Failover Callbacks</title>
|
|
|
|
<para>
|
|
Support for <link linkend="oci8.taf">Oracle Database Transparent Application Failover (TAF) callbacks</link>
|
|
has been added. TAF allows PHP OCI8 applications to
|
|
automatically reconnect to a preconfigured database when a connection
|
|
is broken. The new TAF callback support allows PHP applications to
|
|
monitor and control reconnection during failover.
|
|
</para>
|
|
</sect2>
|
|
|
|
<sect2 xml:id="migration72.new-features.zip">
|
|
<title>Enhancements to the <link linkend="book.zip">ZIP</link> extension</title>
|
|
|
|
<para>
|
|
Read and write support for encrypted archives has been added (requires libzip 1.2.0).
|
|
</para>
|
|
<para>
|
|
The <classname>ZipArchive</classname> class now implements the <interfacename>Countable</interfacename>
|
|
interface.
|
|
</para>
|
|
<para>
|
|
The <literal>zip://</literal> stream now accepts a <literal>'password'</literal> context option.
|
|
</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
|
|
-->
|