php-doc-en/appendices/migration74/other-changes.xml
Martin Samesch 90242f8793
typo
2022-02-10 14:10:34 +01:00

562 lines
16 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<sect1 xml:id="migration74.other-changes" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Other Changes</title>
<sect2 xml:id="migration74.other-changes.performance">
<title>Performance Improvements</title>
<sect3 xml:id="migration74.other-changes.performance.core">
<title>PHP Core</title>
<para>
A specialized VM opcode for the <function>array_key_exists</function>
function has been added, which improves performance of this function
if it can be statically resolved. In namespaced code, this may require
writing <literal>\array_key_exists()</literal> or explicitly importing
the function.
</para>
</sect3>
<sect3 xml:id="migration74.other-changes.performance.pcre">
<title>Regular Expressions (Perl-Compatible)</title>
<para>
When <function>preg_match</function> in UTF-8 mode (<literal>"u"</literal> modifier)
is repeatedly called on the same string (but possibly different offsets),
it will only be checked for UTF-8 validity once.
</para>
</sect3>
</sect2>
<sect2 xml:id="migration74.other-changes.ini">
<title>Changes to INI File Handling</title>
<para>
<link linkend="ini.zend.exception-ignore-args">zend.exception_ignore_args</link> is a new INI directive
for including or excluding arguments from stack traces generated
from exceptions.
</para>
<para>
<link linkend="ini.opcache.preload-user">opcache.preload_user</link> is a new INI directive
for specifying the user account under which preloading
code is execute if it would otherwise be run as root (which is not
allowed for security reasons).
</para>
</sect2>
<sect2 xml:id="migration74.other-changes.pkg-config">
<title>Migration to pkg-config</title>
<para>
A number of extensions have been migrated to exclusively use pkg-config for the
detection of library dependencies. Generally, this means that instead of using
<option role="configure">--with-foo-dir=DIR</option> or similar only
<option role="configure">--with-foo</option> is used. Custom library paths can be
specified either by adding additional directories to <literal>PKG_CONFIG_PATH</literal>
or by explicitly specifying compilation options through <literal>FOO_CFLAGS</literal>
and <literal>FOO_LIBS</literal>.
</para>
<para>
The following extensions and SAPIs are affected:
</para>
<itemizedlist>
<listitem>
<simpara>CURL:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-curl</option> no longer accepts a directory.
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>Enchant:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-enchant</option> no longer accepts a directory.
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>FPM:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-fpm-systemd</option> now uses only pkg-config
for libsystem checks. The libsystemd minimum required version is 209.
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>GD:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-gd</option> becomes
<option role="configure">--enable-gd</option>
(whether to enable the extension at all) and
<option role="configure">--with-external-gd</option>
(to opt into using an external libgd, rather than the bundled one).
</simpara>
</listitem>
<listitem>
<simpara>
<option role="configure">--with-png-dir</option> has been removed. libpng is required.
</simpara>
</listitem>
<listitem>
<simpara>
<option role="configure">--with-zlib-dir</option> has been removed. zlib is required.
</simpara>
</listitem>
<listitem>
<simpara>
<option role="configure">--with-freetype-dir</option>
becomes <option role="configure">--with-freetype</option>
</simpara>
</listitem>
<listitem>
<simpara>
<option role="configure">--with-jpeg-dir</option> becomes
<option role="configure">--with-jpeg</option>
</simpara>
</listitem>
<listitem>
<simpara>
<option role="configure">--with-webp-dir</option> becomes
<option role="configure">--with-webp</option>
</simpara>
</listitem>
<listitem>
<simpara>
<option role="configure">--with-xpm-dir</option> becomes
<option role="configure">--with-xpm</option>
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>IMAP:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-kerberos-systemd</option> no longer accepts a directory.
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>Intl:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-icu-dir</option> has been removed.
If <option role="configure">--enable-intl</option> is passed,
then libicu is always required.
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>LDAP:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-ldap-sasl</option> no longer accepts a directory.
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>Libxml:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-libxml-dir</option> has been removed.
</simpara>
</listitem>
<listitem>
<simpara>
<option role="configure">--enable-libxml</option> becomes
<option role="configure">--with-libxml</option>.
</simpara>
</listitem>
<listitem>
<simpara>
<option role="configure">--with-libexpat-dir</option> has been renamed to
<option role="configure">--with-expat</option> and no longer accepts a directory.
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>Litespeed:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-litespeed</option> becomes
<option role="configure">--enable-litespeed</option>.
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>Mbstring:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-onig</option> has been removed.
Unless <option role="configure">--disable-mbregex</option>
has been passed, libonig is required.
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>ODBC:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-iodbc</option> no longer accepts a directory.
</simpara>
</listitem>
<listitem>
<simpara>
<option role="configure">--with-unixODBC</option> without a directory now uses
pkg-config (preferred). Directory is still accepted for old versions without libodbc.pc.
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>OpenSSL:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-openssl</option> no longer accepts a directory.
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>PCRE:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-pcre-regex</option> has been removed.
Instead <option role="configure">--with-external-pcre</option>
is provided to opt into using an external PCRE library, rather
than the bundled one.
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>PDO_SQLite:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-pdo-sqlite</option> no longer accepts a directory.
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>Readline:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-libedit</option> no longer accepts a directory.
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>Sodium:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-sodium</option> no longer accepts a directory.
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>SQLite3:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-sqlite3</option> no longer accepts a directory.
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>XSL:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-xsl</option> no longer accepts a directory.
</simpara>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<simpara>Zip:</simpara>
<itemizedlist>
<listitem>
<simpara>
<option role="configure">--with-libzip</option> has been removed.
</simpara>
</listitem>
<listitem>
<simpara>
<option role="configure">--enable-zip</option> becomes
<option role="configure">--with-zip</option>.
</simpara>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
</sect2>
<sect2 xml:id="migration74.other-changes.csv">
<title>CSV escaping</title>
<para>
<function>fputcsv</function>,
<function>fgetcsv</function>,
<methodname>SplFileObject::fputcsv</methodname>,
<methodname>SplFileObject::fgetcsv</methodname>, and
<methodname>SplFileObject::setCsvControl</methodname>
now accept an empty string as <literal>$escape</literal> argument,
which disables the proprietary PHP escaping mechanism.
</para>
<para>
The behavior of <function>str_getcsv</function> has been
adjusted accordingly (formerly, an empty string was identical
to using the default).
</para>
<para>
<methodname>SplFileObject::getCsvControl</methodname> now may also
return an empty string for the third array element, accordingly.
</para>
</sect2>
<sect2 xml:id="migration74.other-changes.filter">
<title>Data Filtering</title>
<para>
The <link linkend="book.filter">filter</link> extension no longer exposes
<option role="configure">--with-pcre-dir</option> for Unix builds and can now reliably
be built as shared when using <command>./configure</command>
</para>
</sect2>
<sect2 xml:id="migration74.other-changes.gd">
<title>GD</title>
<para>
The behavior of <function>imagecropauto</function> in the bundled
libgd has been synced with that of system libgd:
</para>
<itemizedlist>
<listitem>
<simpara>
<constant>IMG_CROP_DEFAULT</constant> is no longer falling
back to <constant>IMG_CROP_SIDES</constant>
</simpara>
</listitem>
<listitem>
<simpara>
Threshold-cropping now uses the algorithm of system libgd
</simpara>
</listitem>
</itemizedlist>
<para>
The default <literal>$mode</literal> parameter of
<function>imagecropauto</function> has been changed to
<constant>IMG_CROP_DEFAULT</constant>; passing <literal>-1</literal>
is now deprecated.
</para>
<para>
<function>imagescale</function> now supports aspect ratio preserving
scaling to a fixed height by passing <literal>-1</literal>
as <literal>$new_width</literal>.
</para>
</sect2>
<sect2 xml:id="migration74.other-changes.hash">
<title>HASH Message Digest Framework</title>
<para>
The <link linkend="book.hash">hash</link> extension cannot be disabled
anymore and is always an integral part of any PHP build, similar to
the <link linkend="book.datetime">date</link> extension.
</para>
</sect2>
<sect2 xml:id="migration74.other-changes.intl">
<title>Intl</title>
<para>
The <link linkend="book.intl">intl</link> extension
now requires at least ICU 50.1.
</para>
<para>
<classname>ResourceBundle</classname> now implements
<interfacename>Countable</interfacename>.
</para>
</sect2>
<sect2 xml:id="migration74.other-changes.ldap">
<title>Lightweight Directory Access Protocol</title>
<para>
Support for nsldap and umich_ldap has been removed.
</para>
</sect2>
<sect2 xml:id="migration74.other-changes.libxml">
<title>Libxml</title>
<para>
All libxml-based extensions now require libxml 2.7.6 or newer.
</para>
</sect2>
<sect2 xml:id="migration74.other-changes.mbstring">
<title>Multibyte String</title>
<para>
The oniguruma library is no longer bundled with PHP, instead libonig needs
to be available on the system. Alternatively
<option role="configure">--disable-mbregex</option> can be used to disable
the mbregex component.
</para>
</sect2>
<sect2 xml:id="migration74.other-changes.opcache">
<title>OPcache</title>
<para>
The <option role="configure">--disable-opcache-file</option> and
<option role="configure">--enable-opcache-file</option> configure options
have been removed in favor of the
<link linkend="ini.opcache.file-cache">opcache.file_cache</link> INI directive.
</para>
</sect2>
<sect2 xml:id="migration74.other-changes.password">
<title>Password Hashing</title>
<para>
The <function>password_hash</function> and
<function>password_needs_rehash</function> functions
now accept nullable &string; and &integer; for <literal>$algo</literal> argument.
</para>
</sect2>
<sect2 xml:id="migration74.other-changes.pear">
<title>PEAR</title>
<para>
Installation of PEAR (including PECL) is no longer enabled by default. It
can be explicitly enabled using <option role="configure">--with-pear</option>.
This option is deprecated and may be removed in the future.
</para>
</sect2>
<sect2 xml:id="migration74.other-changes.reflection">
<title>Reflection</title>
<para>
The numeric values of the modifier constants
(<literal>IS_ABSTRACT</literal>,
<literal>IS_DEPRECATED</literal>,
<literal>IS_EXPLICIT_ABSTRACT</literal>,
<literal>IS_FINAL</literal>,
<literal>IS_IMPLICIT_ABSTRACT</literal>,
<literal>IS_PRIVATE</literal>,
<literal>IS_PROTECTED</literal>,
<literal>IS_PUBLIC</literal>, and
<literal>IS_STATIC</literal>) on the
<classname>ReflectionClass</classname>,
<classname>ReflectionFunction</classname>,
<classname>ReflectionMethod</classname>,
<classname>ReflectionObject</classname>, and
<classname>ReflectionProperty</classname>
classes have changed.
</para>
</sect2>
<sect2 xml:id="migration74.other-changes.simplexml">
<title>SimpleXML</title>
<para>
<classname>SimpleXMLElement</classname> now implements
<interfacename>Countable</interfacename>.
</para>
</sect2>
<sect2 xml:id="migration74.other-changes.sqlite3">
<title>SQLite3</title>
<para>
The bundled libsqlite has been removed. To build the
<link linkend="book.sqlite3">SQLite3</link> extension a
system libsqlite3 ≥ 3.7.4 is now required. To build the
<link linkend="ref.pdo-sqlite">PDO_SQLite</link> extension
a system libsqlite3 ≥ 3.5.0 is now required.
</para>
<para>
Serialization and unserialization of <classname>SQLite3</classname>,
<classname>SQLite3Stmt</classname> and <classname>SQLite3Result</classname>
is now explicitly forbidden. Formerly, serialization of instances of
these classes was possible, but unserialization yielded unusable objects.
</para>
<para>
The <literal>@param</literal> notation can now also be used to
denote SQL query parameters.
</para>
</sect2>
<sect2 xml:id="migration74.other-changes.zip">
<title>Zip</title>
<para>
The bundled libzip library has been removed.
A system libzip >= 0.11 is now necessary to build the
<link linkend="book.zip">zip</link> extension.
</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
-->