1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-23 23:32:18 +01:00
Files
archived-doc-en/appendices/migration85/other-changes.xml
2025-11-12 16:17:12 +00:00

628 lines
18 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<sect1 xml:id="migration85.other-changes">
<title>Other Changes</title>
<sect2 xml:id="migration85.other-changes.core">
<title>Core changes</title>
<sect3 xml:id="migration85.other-changes.core.core">
<title>Core</title>
<simpara>
The high resolution timer (<function>hrtime</function>) on macOS now
uses the recommended
<code>clock_gettime_nsec_np(CLOCK_UPTIME_RAW)</code> API instead of
<code>mach_absolute_time()</code>.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.core.cgi-cli">
<title>CGI/CLI</title>
<simpara>
The <option>-z</option> or <option>--zend-extension</option> option
has been removed as it was non-functional.
Use <option>-d zend_extension=[path]</option> instead.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.core.pdo-odbc">
<title>PDO_ODBC</title>
<simpara>
The fetch behaviour for larger columns has been changed. Rather than
fetching 256 byte blocks, PDO_ODBC will try to fetch a larger block size;
currently, this is the page size minus string overhead. Drivers that
return SQL_NO_TOTAL in SQLGetData are also better handled as well.
This should improve compatibility and performance.
<!-- See: GH-10809, GH-10733 -->
</simpara>
</sect3>
</sect2>
<sect2 xml:id="migration85.other-changes.sapi">
<title>Changes in SAPI Modules</title>
<sect3 xml:id="migration85.other-changes.sapi.cli">
<title>CLI</title>
<simpara>
Trying to set a process title that is too long with
<function>cli_set_process_title</function> will now fail instead of
silently truncating the given title.
</simpara>
<simpara>
Added a new <option>--ini=diff</option> option to print INI settings
changed from the builtin default.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.sapi.fpm">
<title>FPM</title>
<simpara>
FPM with httpd ProxyPass optionally decodes the full script path. Added
<!-- <link linkend="ini.fastcgi.script_path_encoded"-->fastcgi.script_path_encoded<!-- </link> -->
INI setting to prevent this new behavior.
</simpara>
<simpara>
FPM access log limit now respects <link linkend="log-limit">log_limit</link> value.
</simpara>
</sect3>
</sect2>
<sect2 xml:id="migration85.other-changes.functions">
<title>Changed Functions</title>
<sect3 xml:id="migration85.other-changes.functions.intl">
<title>Intl</title>
<simpara>
<function>grapheme_extract</function> properly assigns
<parameter>$next</parameter> value when skipping over invalid starting bytes.
Previously there were cases where it would point to the start of the
grapheme boundary instead of the end.
</simpara>
<simpara>
<function>transliterator_get_error_code</function>,
<function>transliterator_get_error_message</function>,
<methodname>TransLiterator::getErrorCode</methodname>,
and <methodname>TransLiterator::getErrorMessage</methodname>
have dropped &false; from the return type union. Returning &false;
was actually never possible.
</simpara>
<simpara>
The following functions now support a <parameter>$locale</parameter> argument:
<function>grapheme_strpos</function>,
<function>grapheme_stripos</function>,
<function>grapheme_strrpos</function>,
<function>grapheme_strripos</function>,
<function>grapheme_substr</function>,
<function>grapheme_strstr</function> and
<function>grapheme_stristr</function>
<!-- RFC: https://wiki.php.net/rfc/grapheme_add_locale_for_case_insensitive -->
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.functions.ldap">
<title>LDAP</title>
<simpara>
<function>ldap_get_option</function> now accepts a &null; connection,
like <function>ldap_set_option</function>, to allow retrieval of global
options.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.functions.libxml">
<title>libxml</title>
<simpara>
<function>libxml_set_external_entity_loader</function> now has a formal
return type of <type>true</type>.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.functions.openssl">
<title>OpenSSL</title>
<simpara>
<function>openssl_public_encrypt</function> and
<function>openssl_private_decrypt</function> have a new parameter
<parameter>$digest_algo</parameter> that allows specifying the hash
digest algorithm for OAEP padding.
</simpara>
<simpara>
<function>openssl_sign</function> and <function>openssl_verify</function>
have a new parameter <parameter>$padding</parameter> to allow using more
secure RSA PSS padding.
</simpara>
<simpara>
<function>openssl_cms_encrypt</function> <parameter>$cipher_algo</parameter>
parameter can be a string with the cipher name.
That allows to use more algorithms including AES GCM cipher algorithms for
auth enveloped data.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.functions.pcntl">
<title>PCNTL</title>
<simpara>
<function>pcntl_exec</function> now has a formal return type of
<type>false</type>.
</simpara>
<simpara>
<function>pcntl_waitid</function> takes an additional resource_usage
argument to gather various platform specific metrics about the child process.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.functions.pdo-pgsql">
<title>PDO_PGSQL</title>
<simpara>
<methodname>Pdo\Pgsql::copyFromArray</methodname> now supports <type>iterable</type> inputs.
</simpara>
<simpara>
<methodname>Pdo\Pgsql::setAttribute</methodname> and
<methodname>Pdo\Pgsql::prepare</methodname> support setting
<constant>PDO::ATTR_PREFETCH</constant> to 0 which enters lazy fetch mode.
In this mode, statements cannot be run in parallel.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.functions.pgsql">
<title>PostgreSQL</title>
<simpara>
<function>pg_copy_from</function> now supports <type>iterable</type> inputs.
</simpara>
<simpara>
<function>pg_connect</function> checks if the connection_string argument
contains any null byte.
</simpara>
<simpara>
<function>pg_close_stmt</function> checks if the statement_name argument
contains any null byte.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.functions.posix">
<title>POSIX</title>
<simpara>
<function>posix_ttyname</function> sets last_error to EBADF when encountering
an invalid file descriptor.
</simpara>
<simpara>
<function>posix_isatty</function> raises an <constant>E_WARNING</constant>
message when encountering an invalid file descriptor.
</simpara>
<simpara>
<function>posix_fpathconf</function> checks invalid file descriptors and
sets last_error to EBADF and raises an <constant>E_WARNING</constant> message.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.functions.reflection">
<title>Reflection</title>
<simpara>
The output of <methodname>ReflectionClass::__toString</methodname> for
enums has changed to better indicate that the class is an enum, and that
the enum cases are enum cases rather than normal class constants.
</simpara>
<simpara>
The output of <methodname>ReflectionProperty::__toString</methodname> for
properties with hooks has changed to indicate what hooks the property has,
whether those hooks are final, and whether the property is virtual.
This also affects the output of <methodname>ReflectionClass::__toString</methodname>
when a class contains hooked properties.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.functions.sockets">
<title>Sockets</title>
<simpara>
<function>socket_create</function>/<function>socket_bind</function> can
create <constant>AF_PACKET</constant> family sockets.
</simpara>
<simpara>
<function>socket_getsockname</function> gets the interface index and its
string representation with <constant>AF_PACKET</constant> socket.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.functions.zlib">
<title>Zlib</title>
<simpara>
The <parameter>$use_include_path</parameter> argument for the
<function>gzfile</function>, <function>gzopen</function> and
<function>readgzfile</function> functions has been changed
from <type>int</type> to <type>bool</type>.
</simpara>
<simpara>
<function>gzfile</function>,
<function>gzopen</function> and <function>readgzfile</function> functions
now respect the default stream context.
</simpara>
</sect3>
</sect2>
<sect2 xml:id="migration85.other-changes.extensions">
<title>Other Changes to Extensions</title>
<sect3 xml:id="migration85.other-changes.extensions.curl">
<title>cURL</title>
<simpara>
<function>curl_setopt</function> with
<constant>CURLOPT_FOLLOWLOCATION</constant> option's value
no longer is treated as boolean but integer to handle
<constant>CURLFOLLOW_OBEYCODE</constant> and
<constant>CURLFOLLOW_FIRSTONLY</constant>.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.extensions.fileinfo">
<title>Fileinfo</title>
<simpara>
Upgraded file from 5.45 to 5.46.
</simpara>
<simpara>
The return type of <function>finfo_close</function> has been changed to
<type>true</type>, rather than <type>bool</type>.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.extensions.intl">
<title>Intl</title>
<simpara>
Intl's internal error mechanism has been modernized so that it
indicates more accurately which call site caused what error.
Moreover, some ext/date exceptions have been wrapped inside a
<classname>IntlException</classname> now.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.extensions.lexbor">
<title>Lexbor</title>
<simpara>
An always enabled lexbor extension is added. It contains the lexbor
library that was separated from <link linkend="book.dom">ext/dom</link>
for being reused among other extensions.
The new extension is not directly exposed to userland.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.extensions.opcache">
<title>Opcache</title>
<simpara>
The <link linkend="book.opcache">Opcache extension</link> is now always
built into the PHP binary and is always loaded.
The INI directives <link linkend="ini.opcache.enable">opcache.enable</link>
and <link linkend="ini.opcache.enable-cli">opcache.enable_cli</link> are
still honored.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.extensions.pcre">
<title>PCRE</title>
<simpara>
Upgraded pcre2lib from 10.44 to 10.46.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.extensions.pdo-sqlite">
<title>PDO_Sqlite</title>
<simpara>
Increased minimum release version support from 3.7.7 to 3.7.17.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.extensions.readline">
<title>Readline</title>
<simpara>
The return types of <function>readline_add_history</function>,
<function>readline_clear_history</function>,
and <function>readline_callback_handler_install</function> have been
changed to <type>true</type>, rather than <type>bool</type>.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.extensions.reflection">
<title>Reflection</title>
<simpara>
<classname>ReflectionConstant</classname> is no longer final.
</simpara>
</sect3>
</sect2>
<sect2 xml:id="migration85.other-changes.ini">
<title>Changes to INI File Handling</title>
<sect3 xml:id="migration85.other-changes.ini.core">
<title>Core</title>
<simpara>
Added fatal_error_backtraces to control whether fatal errors should include
a backtrace.
<!-- RFC: https://wiki.php.net/rfc/error_backtraces_v2 -->
</simpara>
<simpara>
Added startup-only max_memory_limit INI setting to control the maximum
memory_limit that may be configured at startup or runtime. Exceeding this
value emits a warning, unless set to -1, and sets memory_limit to the
current max_memory_limit instead.
<!-- ML discussion: https://externals.io/message/127108 -->
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.ini.opcache">
<title>Opcache</title>
<simpara>
Added opcache.file_cache_read_only to support a read-only
<link linkend="ini.opcache.file-cache">opcache.file_cache</link> directory,
for use with read-only file systems (e.g. read-only Docker containers).
Best used with <literal>opcache.validate_timestamps=0</literal>,
<literal>opcache.enable_file_override=1</literal>,
and <literal>opcache.file_cache_consistency_checks=0</literal>.
</simpara>
<note>
<simpara>
A cache generated with a different build of PHP, a different file
path, or different settings (including which extensions are loaded), may be
ignored.
</simpara>
</note>
<simpara>
The default value of
<link linkend="ini.opcache.jit-hot-loop">opcache.jit_hot_loop</link> is
now 61 (a prime) to prevent it from being a multiple of loop iteration
counts.
It is recommended that this parameter is set to a prime number.
</simpara>
<simpara>
Changing <link
linkend="ini.opcache.memory-consumption">opcache.memory_consumption</link>
when OPcache SHM is already set up will now correctly report a failure
instead of silently doing nothing and showing misleading values in PHPInfo.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.ini.openssl">
<title>OpenSSL</title>
<simpara>
Added <!-- <link linkend="ini.openssl.libctx"-->openssl.libctx<!-- </link> -->
to select the OpenSSL library context type.
Either custom libctx for each thread can be used or a single global (default)
libctx is used.
</simpara>
</sect3>
</sect2>
<sect2 xml:id="migration85.other-changes.performance">
<title>Performance</title>
<sect3 xml:id="migration85.other-changes.performance.core">
<title>Core</title>
<simpara>
Remove OPcodes for identity comparisons against booleans, particularly
for the <code>match(true)</code> pattern.
</simpara>
<simpara>
Add OPcode specialization for <code>=== []</code> and
<code>!== []</code> comparisons.
</simpara>
<simpara>
Creating exception objects is now much faster.
</simpara>
<simpara>
The parts of the code that used SSE2 have been adapted to use SIMD
with ARM NEON as well.
</simpara>
<simpara>
Introduced the TAILCALL VM, enabled by default when compiling with Clang>=19
on x86_64 or aarch64. The TAILCALL VM is as fast as the HYBRID VM used when
compiling with GCC. This makes PHP binaries built with Clang>=19 as fast as
binaries built with GCC. The performance of the CALL VM, used with other
compilers, has also improved considerably.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.performance.intl">
<title>Intl</title>
<simpara>
Now avoids creating extra string copies when converting strings
for use in the collator.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.performance.mbstring">
<title>MBString</title>
<simpara>
The parts of the code that used SSE2 have been adapted to use SIMD
with ARM NEON as well.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.performance.opcache">
<title>Opcache</title>
<simpara>
Improved performance of fetching TLS variables in JIT'ed code in non-Glibc
builds.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.performance.reflection">
<title>Reflection</title>
<para>
Improved performance of the following methods:
<simplelist>
<member><methodname>ReflectionProperty::getValue</methodname></member>
<member><methodname>ReflectionProperty::getRawValue</methodname></member>
<member><methodname>ReflectionProperty::isInitialized</methodname></member>
<member><methodname>ReflectionProperty::isInitialized</methodname></member>
<member><methodname>ReflectionProperty::setValue</methodname></member>
<member><methodname>ReflectionProperty::setRawValue</methodname></member>
</simplelist>
</para>
</sect3>
<sect3 xml:id="migration85.other-changes.performance.spl">
<title>SPL</title>
<simpara>
Improved performance of dimension accessors and methods of
<classname>SplFixedArray</classname>.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.performance.standard">
<title>Standard</title>
<simpara>
Improved performance of array functions with callbacks
(<function>array_find</function>, <function>array_filter</function>,
<function>array_map</function>, <function>usort</function>, ...).
</simpara>
<simpara>
Improved performance of <function>urlencode</function> and
<function>rawurlencode</function>.
</simpara>
<simpara>
Improved <function>unpack</function> performance with nameless
repetitions by avoiding creating temporary strings and reparsing them.
</simpara>
<simpara>
Improved <function>pack</function> performance.
</simpara>
<simpara>
Minor improvements in <function>array_chunk</function> performance.
</simpara>
</sect3>
<sect3 xml:id="migration85.other-changes.performance.xml">
<title>XML</title>
<simpara>
Improved <classname>XMLReader</classname> property access performance.
</simpara>
<simpara>
Improved <classname>XMLWriter</classname> performance and reduced memory
consumption.
</simpara>
</sect3>
</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
-->