Core changes
FPM
FPM CLI test now fails if the socket path is longer than supported by the OS.
Opcache
In the CLI and phpdbg SAPIs, preloading does not require the
opcache.preload_user
directive to be set anymore when running as root.
In other SAPIs, this directive is required when running as root because
preloading is done before the SAPI switches to an unprivileged user.
Streams
Blocking fread() on a socket connection returns
immediately if there are any buffered data instead of waiting for more data.
A memory stream no longer fails if the seek offset is past the end.
Instead, the memory will be increased on the next write and the data between
the old end and the offset is filled with zero bytes, similar to how files work.
stat() access operations like
file_exists() and similar will now use real
path instead of the actual stream path. This is consistent with stream
opening.
Changed Functions
Core
gc_status() has added the following 8 fields:
"running" => bool
"protected" => bool
"full" => bool
"buffer_size" => int
"application_time" => float: Total application
time, in seconds (including collector_time)
"collector_time" => float: Time spent collecting
cycles, in seconds (including destructor_time and free_time)
"destructor_time" => float: Time spent executing
destructors during cycle collection, in seconds
"free_time" => float: Time spent freeing values
during cycle collection, in seconds
class_alias() now supports creating an alias of an
internal class.
Setting open_basedir at runtime
using ini_set('open_basedir', ...); no longer accepts paths
containing the parent directory (..). Previously,
only paths starting with .. were disallowed. This could
easily be circumvented by prepending ./ to the path.
User exception handlers now catch exceptions during shutdown.
The resultant HTML of highlight_string() and
highlight_file() has changed.
Whitespace between outer HTML tags is removed. Newlines and spaces
are no longer converted to HTML entities. The whole HTML is now wrapped in a
<pre> tag. The outer <span>
tag has been merged with the <code> tag.
Calendar
easter_date() now supports years from 1970 to
2,000,000,000 on 64-bit systems, previously it only supported years in the
range from 1970 to 2037.
Gd
The signature of imagerotate() has changed.
The ignore_transparent parameter has been removed,
as it was ignored since PHP 5.5.0.
MBString
mb_strtolower() and mb_convert_case()
implement conditional casing rules for the Greek letter sigma.
For mb_convert_case(),
conditional casing only applies to MB_CASE_LOWER
and MB_CASE_TITLE modes, not to
MB_CASE_LOWER_SIMPLE and
MB_CASE_TITLE_SIMPLE.
mb_decode_mimeheader() interprets underscores in
QPrint-encoded MIME encoded words as required by RFC 2047; they are
converted to spaces.
Underscores must be encoded as "=5F" in such MIME
encoded words.
In rare cases, mb_encode_mimeheader() will transfer-encode
its input string where it would pass it through as raw ASCII in PHP 8.2.
mb_encode_mimeheader() no longer drops NUL (zero)
bytes when QPrint-encoding the input string.
This previously caused strings in certain text encodings, especially
UTF-16 and UTF-32, to be corrupted by mb_encode_mimeheader.
mb_detect_encoding()'s "non-strict" mode now behaves
as described in the documentation.
Previously, it would return false if the same byte (for example, the first
byte) of the input string was invalid in all candidate encodings.
More generally, it would eliminate candidate encodings from consideration
when an invalid byte was seen, and if the same input byte eliminated all
remaining encodings still under consideration, it would return false.
On the other hand, if all candidate encodings but one were eliminated
from consideration, it would return the last remaining one without regard
for how many encoding errors might be encountered later in the string.
This is different from the behavior described in the documentation, which
says: "If strict is set to false, the closest matching encoding will be
returned."
ODBC
odbc_autocommit() now accepts null for the
enable parameter.
Passing null has the same behaviour as passing only 1 parameter,
namely indicating if the autocommit feature is enabled or not.
Standard
E_NOTICEs emitted by unserialize()
have been promoted to E_WARNING.
unserialize() now emits a new E_WARNING
if the input contains unconsumed bytes.
array_pad() is now only limited by the maximum number of
elements an array can have. Before, it was only possible to add at most 1048576
elements at a time.
strtok() raises an E_WARNING in the
case token is not provided when starting tokenization.
password_hash() will now chain the underlying
Random\RandomException
as the ValueError's previous
Exception when salt generation fails.
If using an array as the command
for proc_open(), it must now have at least one
non empty element. Otherwise a ValueError
is thrown.
proc_open() returns false if command
array is invalid command instead of resource object that produces warning later.
This was already the case for Windows but it is now also the case if a posix_spawn
implementation is in use (most Linux, BSD and MacOS platforms). There are still
some old platforms where this behavior is not changed as posix_spawn is not
supported there.
array_sum() and array_product() now
warn when values in the array cannot be converted to int/float.
Previously arrays and objects where ignored whilst every other value was
cast to int. Moreover, objects that define a numeric cast (e.g.
GMP) are now casted instead of ignored.
The decimals of number_format()
now properly handles negative integers.
Rounding with a negative value for decimals means
that num is rounded to decimals
significant digits before the decimal point.
Previously negative decimals were silently
ignored and the number got rounded to zero decimal places.
A new before_needle argument has been added to
strrchr(). It behaves like its counterpart in the
strstr() or stristr() functions.
str_getcsv() and fgetcsv() now return
an empty string instead of a string with a single null byte for the last field
which only contains an unterminated enclosure.