Core changes
Closures
Closure names have been adjusted to include the parent function's name
and the line of definition to make them easier to distinguish, for example
within stack traces.
Fibers
Fiber switching during destructor execution is now allowed. It was previously
blocked due to conflicts with garbage collection.
Destructors may now be executed in a separate Fiber:
When garbage collection is triggered in a Fiber,
destructors called by the GC are executed in a separate Fiber:
the gc_destructor_fiber.
If this Fiber suspends, a new one is created to execute the remaining
destructors.
The previous gc_destructor_fiber is not referenced anymore by the GC
and may be collected if it's not referenced anywhere else.
Objects whose destructor is suspended will not be collected until the
destructor returns or the Fiber is collected.
Changes in SAPI Modules
apache2handler
Support for EOL Apache 2.0 and 2.2 has been removed.
Minimum required Apache version is now 2.4.
CLI
The builtin server looks for an index file recursively by traversing parent
directories in case the specified file cannot be located.
This process was previously skipped if the path looked like it was
referring to a file, i.e. if the last path component contained a period.
In that case, a 404 error was returned.
The behavior has been changed to look for an index file in all cases.
FPM
Flushing headers without a body will now succeed.
Status page has a new field to display a memory peak.
The /dev/poll events.mechanism
setting for Solaris/Illumos had been retired.
Changed Functions
LibXML
libxml_set_streams_context() now immediately throws a
TypeError when a non-stream-context
resource is passed to the function,
instead of throwing later when the stream context is used.
MBString
The behavior of mb_strcut() is more consistent
now on invalid UTF-8 and UTF-16 strings.
There is no behavioural change for valid UTF-8 and UTF-16 strings.
OpenSSL
The extra_attributes in
openssl_csr_new() sets the CSR
attributes instead of subject DN, which incorrectly done previously.
The dn in
openssl_csr_new() allows setting an array
of values for a single entry.
New serial_hex added to
openssl_csr_sign() to allow setting serial numbers
in the hexadecimal format.
Parsing ASN.1 UTCTime with openssl_x509_parse()
fails if seconds are omitted for OpenSSL version below 3.2
(-1 is returned for such fields).
OpenSSL version above 3.3 did not load such certificates already.
PDO_FIREBIRD
It is now possible to fetch the value of the
FB_ATTR_DATE_FORMAT,
FB_ATTR_TIME_FORMAT,
FB_ATTR_TIMESTAMP_FORMAT,
attributes with
PDO::getAttribute().
Added new attributes to specify transaction isolation level and access mode.
Five constants relating to this functionality have been added:
When using persistent connections, there is now a liveliness check in the
constructor.
The content that is built changes depending on the value of
FB_API_VER in
ibase.h.
A new static method Pdo\Firebird::getApiVersion()
can be used to obtain this information.
This information is also now referenced in phpinfo().
Five new data types are now available:
INT128, DEC16, DEC34, TIMESTAMP_TZ, TIME_TZ
.
These are available starting with Firebird 4.0.
PGSQL
The conditions parameter of
pg_select() is now optional and accepts an empty array.
POSIX
posix_isatty() now sets the error number when the
file descriptor/stream argument is invalid.
Sodium
The sodium_crypto_aead_aes256gcm_*
functions are now available on aarch64 CPUs with the ARM cryptographic
extensions.
Standard
The default 'cost' value for the PASSWORD_BCRYPT
hashing algorithm for password_hash() has been increased from
10 to 12.
debug_zval_dump() now indicates whether an array is packed.
long2ip() now has a return type of string
instead of string|false.
highlight_string() now has a return type of
string|true instead of string|bool.
print_r() now has a return type of
string|true instead of string|bool.
The mode parameter of the
round() function has been widened to
RoundingMode|int,
accepting instances of a new RoundingMode enum.
Four new modes have been added to the round() function:
RoundingMode::PositiveInfinity, RoundingMode::NegativeInfinity, RoundingMode::TowardsZero, RoundingMode::AwayFromZero
The internal implementation for rounding to integers has been rewritten
to be easier to verify for correctness and to be easier to maintain.
Some rounding bugs have been fixed as a result of the rewrite.
For example previously rounding 0.49999999999999994
to the nearest integer would have resulted in 1.0
instead of the correct result 0.0.
Additional inputs might also be affected and result in different outputs
compared to earlier PHP versions.
Fixed a bug caused by "pre-rounding" of the round() function.
Previously, using "pre-rounding" to treat a value like 0.285
(actually 0.28499999999999998) as a decimal number
and round it to 0.29.
However, "pre-rounding" incorrectly rounds certain numbers,
so this fix removes "pre-rounding" and changes the way numbers are compared,
so that the values are correctly rounded as decimal numbers.
The maximum precision that can be handled by round()
has been extended by one digit.
For example, round(4503599627370495.5) returned in
4503599627370495.5,
but now returns 4503599627370496.
Other Changes to Extensions
cURL
The minimum libcurl version required is now 7.61.0.
The CURLOPT_DNS_USE_GLOBAL_CACHE option no longer
has any effect, and is silently ignored.
This underlying feature was deprecated in libcurl 7.11.1,
and removed in libcurl 7.62.0.
GMP
Casting a GMP object to bool is now
possible instead of emitting a E_RECOVERABLE_ERROR.
The casting behaviour is overloaded such that a GMP
object representing the value 0 is cast to false.
LibXML
The minimum libxml2 version required is now 2.9.4.
Intl
Cloning an Intl object consistently throws an
Error when the clone cannot be performed,
either because the object has not been initialized, or because the
underlying ICU clone operation failed. Formerly, most of these classes
threw an Exception instead, and
Spoofchecker raised a fatal error.
MBString
Unicode data tables have been updated to Unicode 16.0.
MySQLnd
Support for the new VECTOR data type from MySQL 9.
OpenSSL
The minimum OpenSSL version required is now 1.1.1.
PDO_PGSQL
The minimum libpq version required is now 10.0.
PGSQL
The minimum libpq version required is now 10.0.
Zlib
The minimum zlib version required is now 1.2.11.