2023-08-30 03:25:46 +08:00
|
|
|
|
PHP 8.4 UPGRADE NOTES
|
2012-03-06 04:14:04 +08:00
|
|
|
|
|
|
|
|
|
1. Backward Incompatible Changes
|
|
|
|
|
2. New Features
|
2014-05-01 18:27:38 +08:00
|
|
|
|
3. Changes in SAPI modules
|
|
|
|
|
4. Deprecated Functionality
|
|
|
|
|
5. Changed Functions
|
|
|
|
|
6. New Functions
|
|
|
|
|
7. New Classes and Interfaces
|
2015-02-10 15:56:18 +08:00
|
|
|
|
8. Removed Extensions and SAPIs
|
2014-05-01 18:27:38 +08:00
|
|
|
|
9. Other Changes to Extensions
|
|
|
|
|
10. New Global Constants
|
|
|
|
|
11. Changes to INI File Handling
|
2014-08-22 19:35:07 +08:00
|
|
|
|
12. Windows Support
|
2019-01-28 17:34:31 +08:00
|
|
|
|
13. Other Changes
|
|
|
|
|
14. Performance Improvements
|
2010-03-25 00:23:50 +08:00
|
|
|
|
|
|
|
|
|
========================================
|
2012-03-06 04:14:04 +08:00
|
|
|
|
1. Backward Incompatible Changes
|
2010-03-25 00:23:50 +08:00
|
|
|
|
========================================
|
2016-04-25 05:49:52 +08:00
|
|
|
|
|
2023-12-21 22:09:27 +08:00
|
|
|
|
- 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.
|
|
|
|
|
|
2024-01-07 21:38:26 +08:00
|
|
|
|
- Core:
|
|
|
|
|
. The type of PHP_DEBUG and PHP_ZTS constants changed to bool.
|
|
|
|
|
|
2023-09-09 07:14:26 +08:00
|
|
|
|
- DOM:
|
|
|
|
|
. New methods and constants were added to some DOM classes. If you inherit
|
|
|
|
|
from these and you happen to have a method or property with the same name,
|
|
|
|
|
you might encounter errors if the declaration is incompatible.
|
|
|
|
|
Consult sections 2. New Features and 6. New Functions for a list of
|
|
|
|
|
newly implemented methods and constants.
|
2023-12-05 06:49:25 +08:00
|
|
|
|
. Some DOM methods previously returned false or a PHP_ERR DOMException if a new
|
|
|
|
|
node could not be allocated. They consistently throw an INVALID_STATE_ERR
|
|
|
|
|
DOMException now. This situation is extremely unlikely though and probably
|
|
|
|
|
will not affect you. As a result DOMImplementation::createDocument() now has
|
|
|
|
|
a tentative return type of DOMDocument instead of DOMDocument|false.
|
2024-02-23 06:42:17 +08:00
|
|
|
|
. Previously, DOMXPath objects could be cloned, but resulted in an unusable
|
|
|
|
|
object. This is no longer possible, and cloning a DOMXPath object now throws
|
|
|
|
|
an error.
|
2023-09-09 07:14:26 +08:00
|
|
|
|
|
2024-02-27 01:03:17 +08:00
|
|
|
|
- Intl:
|
|
|
|
|
. resourcebundle_get(), ResourceBundle::get(), and accessing offsets on a
|
|
|
|
|
ResourceBundle object now throw:
|
|
|
|
|
- TypeError for invalid offset types
|
|
|
|
|
- ValueError for an empty string
|
|
|
|
|
- ValueError if the integer index does not fit in a signed 32 bit integer
|
|
|
|
|
|
2023-12-07 07:47:00 +08:00
|
|
|
|
- MBString:
|
|
|
|
|
. mb_encode_numericentity() and mb_decode_numericentity() now check that
|
|
|
|
|
the $map is only composed of integers, if not a ValueError is thrown.
|
2023-12-08 01:23:01 +08:00
|
|
|
|
. mb_http_input() now always throws a ValueError if the $type is invalid.
|
2023-12-10 21:02:26 +08:00
|
|
|
|
. On invalid strings (those with encoding errors), mb_substr() now interprets
|
|
|
|
|
character indices in the same manner as most other mbstring functions. This
|
|
|
|
|
means that character indices returned by mb_strpos() can be passed to mb_substr().
|
|
|
|
|
. For SJIS-Mac (MacJapanese) strings, character indices passed to mb_substr() now
|
|
|
|
|
refer to the indices of the Unicode codepoints which are produced when the string
|
|
|
|
|
is converted to Unicode. This is significant because around 40 SJIS-Mac characters
|
|
|
|
|
convert to a sequence of multiple Unicode codepoints.
|
2023-12-07 07:47:00 +08:00
|
|
|
|
|
2023-11-29 03:14:58 +08:00
|
|
|
|
- Opcache:
|
|
|
|
|
. The JIT config defaults changed from opcache.jit=tracing and
|
|
|
|
|
opcache.jit_buffer_size=0 to opcache.jit=disable and
|
|
|
|
|
opcache.jit_buffer_size=64M, respectively. This does not affect the default
|
|
|
|
|
behavior, the JIT is still disabled by default. However, it is now disabled
|
|
|
|
|
through the opcache.jit setting, rather than opcache.jit_buffer_size. This
|
|
|
|
|
may affect users who previously enabled JIT through opcache.jit_buffer_size
|
|
|
|
|
exclusively, without also specifying a JIT mode using opcache.jit. To enable
|
|
|
|
|
JIT, set the opcache.jit config value accordingly.
|
2024-03-19 20:06:29 +08:00
|
|
|
|
. The maximum value of the opcache.interned_strings_buffer setting on 64bit
|
|
|
|
|
architectures is now 32767 (it was previously 4095).
|
2023-11-29 03:14:58 +08:00
|
|
|
|
|
2024-02-17 21:15:04 +08:00
|
|
|
|
- PCRE:
|
|
|
|
|
. The bundled pcre2lib has been updated to version 10.43.
|
|
|
|
|
As a consequence, this means {,3} is now recognized as a quantifier instead
|
|
|
|
|
of as text. Furthermore, the meaning of some character classes in UCP mode
|
|
|
|
|
has changed. Consult https://github.com/PCRE2Project/pcre2/blob/master/NEWS
|
|
|
|
|
for a full changelog.
|
|
|
|
|
|
2023-12-05 00:05:30 +08:00
|
|
|
|
- PDO_DBLIB:
|
|
|
|
|
. setAttribute, DBLIB_ATTR_STRINGIFY_UNIQUEIDENTIFIER and DBLIB_ATTR_DATETIME_CONVERT
|
|
|
|
|
have been changed to set value as a bool.
|
|
|
|
|
|
|
|
|
|
- PDO_FIREBIRD:
|
|
|
|
|
. getAttribute, ATTR_AUTOCOMMIT has been changed to get the value as a bool.
|
|
|
|
|
|
|
|
|
|
- PDO_MYSQL:
|
|
|
|
|
. getAttribute, ATTR_AUTOCOMMIT, ATTR_EMULATE_PREPARES, MYSQL_ATTR_DIRECT_QUERY have
|
|
|
|
|
been changed to get values as bool.
|
|
|
|
|
|
2023-10-12 09:35:42 +08:00
|
|
|
|
- PDO_PGSQL:
|
|
|
|
|
. The DSN's credentials, when set, are given priority over their PDO
|
|
|
|
|
constructor counterparts, being closer to the documentation states.
|
|
|
|
|
|
2023-11-16 08:40:18 +08:00
|
|
|
|
- PCNTL:
|
|
|
|
|
. The functions pcntl_sigprocmask(), pcntl_sigwaitinfo() and
|
|
|
|
|
pcntl_sigtimedwait() now throw:
|
|
|
|
|
- A ValueError if the $signals array is empty (except for
|
|
|
|
|
pcntl_sigprocmask() if the $mode is SIG_SETMASK).
|
|
|
|
|
- A TypeError if a value of the $signals array is not an integer
|
|
|
|
|
- A ValueError if a value of the $signals array is not a valid signal number
|
|
|
|
|
Moreover, those functions now always return false on failure.
|
|
|
|
|
In some case previously it could return the value -1.
|
|
|
|
|
. The function pcntl_sigprocmask() will also now throw:
|
|
|
|
|
- A ValueError if $mode is not one of SIG_BLOCK, SIG_UNBLOCK, or SIG_SETMASK
|
|
|
|
|
. The function pcntl_sigtimedwait() will also now throw:
|
|
|
|
|
- A ValueError if $seconds is less than 0
|
|
|
|
|
- A ValueError if $nanoseconds is less than 0 or greater than 1e9
|
|
|
|
|
- A ValueError if both $seconds and $nanoseconds are 0
|
|
|
|
|
|
2023-10-01 00:00:45 +08:00
|
|
|
|
- SimpleXML:
|
|
|
|
|
. Get methods called, or casting to a string on a SimpleXMLElement will no
|
|
|
|
|
longer implicitly reset the iterator data, unless explicitly rewound.
|
|
|
|
|
For example, casting an element to a string within a foreach loop would
|
|
|
|
|
cause an infinite loop because it destroyed the current iterator data.
|
|
|
|
|
This is no longer the case as a consequence of the bugfixes for GH-12192,
|
|
|
|
|
GH-12208, #55098.
|
2024-01-19 03:28:01 +08:00
|
|
|
|
. Calling simplexml_import_dom() with a non-XML object now throws a TypeError
|
|
|
|
|
instead of a ValueError.
|
2023-08-21 13:14:45 +08:00
|
|
|
|
|
2023-10-09 00:57:57 +08:00
|
|
|
|
- SPL:
|
|
|
|
|
. Out of bounds accesses in SplFixedArray now throw an exception of type
|
|
|
|
|
OutOfBoundsException instead of RuntimeException. As OutOfBoundsException
|
|
|
|
|
is a child class of RuntimeException, code that uses RuntimeException
|
|
|
|
|
continues to function.
|
|
|
|
|
|
2023-09-22 23:35:03 +08:00
|
|
|
|
- Standard:
|
|
|
|
|
. round() now validates the value of the $mode parameter and throws a ValueError
|
|
|
|
|
for invalid modes. Previously invalid modes would have been interpreted as
|
|
|
|
|
PHP_ROUND_HALF_UP.
|
2023-11-04 21:54:30 +08:00
|
|
|
|
. strcspn() with empty $characters now returns the length of the string instead
|
|
|
|
|
of incorrectly stopping at the first NUL character. See GH-12592.
|
2023-09-22 23:35:03 +08:00
|
|
|
|
|
2023-10-20 20:14:55 +08:00
|
|
|
|
- XML:
|
|
|
|
|
. The xml_set_*_handler() functions now declare and check for an effective
|
|
|
|
|
signature of callable|string|null for the $handler parameters.
|
|
|
|
|
Moreover, values of type string that correspond to method names,
|
|
|
|
|
of object set with xml_set_object() are now checked to see if the method
|
|
|
|
|
exists on the class of the previously passed object.
|
|
|
|
|
This means that xml_set_object() must now always be called prior to setting
|
|
|
|
|
method names as callables.
|
|
|
|
|
Passing an empty string to disable the handler is still allowed,
|
|
|
|
|
but not recommended.
|
|
|
|
|
|
2023-09-30 19:59:08 +08:00
|
|
|
|
- XSL:
|
|
|
|
|
. XSLTProcessor::setParameter() will now throw a ValueError when its arguments
|
|
|
|
|
contain null bytes. This never actually worked correctly in the first place,
|
|
|
|
|
which is why it throws an exception nowadays.
|
2024-01-13 07:00:26 +08:00
|
|
|
|
. Failure to call a PHP function callback during evaluation now throws
|
|
|
|
|
instead of emitting a warning.
|
|
|
|
|
RFC: https://wiki.php.net/rfc/improve_callbacks_dom_and_xsl
|
2024-01-19 03:28:01 +08:00
|
|
|
|
. Calling XSLTProcessor::importStyleSheet() with a non-XML object now throws
|
|
|
|
|
a TypeError instead of a ValueError.
|
2023-09-30 19:59:08 +08:00
|
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
|
|
|
|
2. New Features
|
|
|
|
|
========================================
|
2009-01-29 01:23:28 +08:00
|
|
|
|
|
2023-06-18 04:26:21 +08:00
|
|
|
|
- Core:
|
|
|
|
|
. Added request_parse_body() function that allows parsing RFC1867 (multipart)
|
|
|
|
|
requests in non-POST HTTP requests.
|
|
|
|
|
RFC: https://wiki.php.net/rfc/rfc1867-non-post
|
2024-03-09 01:31:24 +08:00
|
|
|
|
. Getting the debug info for WeakReference will now also output the object
|
|
|
|
|
it references, or null if the reference is no longer valid.
|
2023-06-18 04:26:21 +08:00
|
|
|
|
|
2024-03-03 02:34:03 +08:00
|
|
|
|
- Curl:
|
|
|
|
|
. curl_version() returns an additional feature_list value, which is an
|
|
|
|
|
associative array of all known Curl features, and whether they are
|
|
|
|
|
supported (true) or not (false).
|
|
|
|
|
|
2023-12-17 15:17:11 +08:00
|
|
|
|
- Date:
|
|
|
|
|
. Added static methods
|
|
|
|
|
DateTime[Immutable]::createFromTimestamp(int|float $timestamp): static.
|
2024-03-06 17:18:22 +08:00
|
|
|
|
. Added method DateTime[Immutable]::getMicrosecond(): int.
|
2024-02-05 20:14:18 +08:00
|
|
|
|
. Added method
|
2024-03-06 17:18:22 +08:00
|
|
|
|
DateTime[Immutable]::setMicrosecond(int $microsecond): static.
|
2023-12-17 15:17:11 +08:00
|
|
|
|
|
2023-09-09 07:14:26 +08:00
|
|
|
|
- DOM:
|
|
|
|
|
. Added constant DOMNode::DOCUMENT_POSITION_DISCONNECTED.
|
|
|
|
|
. Added constant DOMNode::DOCUMENT_POSITION_PRECEDING.
|
|
|
|
|
. Added constant DOMNode::DOCUMENT_POSITION_FOLLOWING.
|
|
|
|
|
. Added constant DOMNode::DOCUMENT_POSITION_CONTAINS.
|
|
|
|
|
. Added constant DOMNode::DOCUMENT_POSITION_CONTAINED_BY.
|
|
|
|
|
. Added constant DOMNode::DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC.
|
2024-01-13 07:00:26 +08:00
|
|
|
|
. It is now possible to pass any callable to registerPhpFunctions().
|
|
|
|
|
RFC: https://wiki.php.net/rfc/improve_callbacks_dom_and_xsl
|
2023-09-09 07:14:26 +08:00
|
|
|
|
|
2023-11-26 07:11:22 +08:00
|
|
|
|
- FPM:
|
|
|
|
|
. Flushing headers without a body will now succeed. See GH-12785.
|
|
|
|
|
|
2024-03-03 02:34:03 +08:00
|
|
|
|
- Intl:
|
|
|
|
|
. NumberFormatter::ROUND_HALFODD added to complement existing
|
|
|
|
|
NumberFormatter::ROUND_HALFEVEN functionality.
|
|
|
|
|
|
2023-10-29 01:48:01 +08:00
|
|
|
|
- Phar:
|
|
|
|
|
. Added support for the unix timestamp extension for zip archives.
|
|
|
|
|
|
2024-02-17 21:15:04 +08:00
|
|
|
|
- PCRE:
|
|
|
|
|
. The bundled pcre2lib has been updated to version 10.43.
|
|
|
|
|
As a consequence, LoongArch JIT support has been added, spaces
|
|
|
|
|
are now allowed between braces in Perl-compatible items, and
|
|
|
|
|
variable-length lookbehind assertions are now supported.
|
2024-03-06 03:51:04 +08:00
|
|
|
|
. Added support for the "r" (PCRE2_EXTRA_CASELESS_RESTRICT) modifier, as well
|
|
|
|
|
as the (?r) mode modifier. When enabled along with the case-insensitive
|
|
|
|
|
modifier ("i"), the expression locks out mixing of ASCII and non-ASCII
|
|
|
|
|
characters.
|
2024-02-17 21:15:04 +08:00
|
|
|
|
|
2024-01-12 05:58:28 +08:00
|
|
|
|
- PDO:
|
|
|
|
|
. Added support for driver-specific subclasses.
|
|
|
|
|
RFC: https://wiki.php.net/rfc/pdo_driver_specific_subclasses
|
|
|
|
|
This RFC adds subclasses for PDO in order to better support
|
|
|
|
|
database-specific functionalities. The new classes are
|
|
|
|
|
instantiatable either via calling the PDO::connect() method
|
|
|
|
|
or by invoking their constructor directly.
|
|
|
|
|
|
2024-02-05 06:02:58 +08:00
|
|
|
|
- PDO_DBLIB:
|
2024-03-03 02:34:03 +08:00
|
|
|
|
. Added class PdoDbLib.
|
2024-01-12 05:58:28 +08:00
|
|
|
|
|
2024-02-05 06:02:58 +08:00
|
|
|
|
- PDO_FIREBIRD:
|
2024-01-12 05:58:28 +08:00
|
|
|
|
. Added class PdoFirebird.
|
|
|
|
|
|
2024-02-05 06:02:58 +08:00
|
|
|
|
- PDO_MYSQL:
|
2024-01-12 05:58:28 +08:00
|
|
|
|
. Added class PdoMysql.
|
|
|
|
|
|
2024-02-05 06:02:58 +08:00
|
|
|
|
- PDO_ODBC:
|
2024-01-12 05:58:28 +08:00
|
|
|
|
. Added class PdoOdbc.
|
|
|
|
|
|
2024-02-05 06:02:58 +08:00
|
|
|
|
- PDO_PGSQL:
|
2024-01-12 05:58:28 +08:00
|
|
|
|
. Added class PdoPgsql.
|
|
|
|
|
|
2024-02-05 06:02:58 +08:00
|
|
|
|
- PDO_SQLITE:
|
2024-01-12 05:58:28 +08:00
|
|
|
|
. Added class PdoSqlite.
|
|
|
|
|
|
2023-11-16 17:36:20 +08:00
|
|
|
|
- POSIX:
|
|
|
|
|
. Added constant POSIX_SC_CHILD_MAX
|
|
|
|
|
. Added constant POSIX_SC_CLK_TCK
|
|
|
|
|
|
2023-12-10 04:37:52 +08:00
|
|
|
|
- Reflection:
|
|
|
|
|
. ReflectionAttribute now contains a $name property to improve the debugging
|
|
|
|
|
experience.
|
2024-02-25 23:02:09 +08:00
|
|
|
|
. ReflectionClassConstant::__toString() and ReflectionProperty::__toString()
|
|
|
|
|
now returns the attached doc comments.
|
2023-12-10 04:37:52 +08:00
|
|
|
|
|
2023-10-12 11:30:04 +08:00
|
|
|
|
- SOAP:
|
|
|
|
|
. Added support for clark notation for namespaces in class map.
|
|
|
|
|
It is now possible to specify entries in a class map with clark notation
|
|
|
|
|
to resolve a type with a specific namespace to a specific class.
|
|
|
|
|
For example: '{http://example.com}foo' => 'FooClass'.
|
2023-10-14 23:57:45 +08:00
|
|
|
|
. Instances of DateTimeInterface that are passed to xsd:datetime or similar
|
|
|
|
|
elements are now serialized as such instead of being serialized as an
|
|
|
|
|
empty string.
|
2023-10-12 11:30:04 +08:00
|
|
|
|
|
2023-09-30 19:59:08 +08:00
|
|
|
|
- XSL:
|
|
|
|
|
. It is now possible to use parameters that contain both single and double
|
|
|
|
|
quotes.
|
2024-01-13 07:00:26 +08:00
|
|
|
|
. It is now possible to pass any callable to registerPhpFunctions().
|
|
|
|
|
RFC: https://wiki.php.net/rfc/improve_callbacks_dom_and_xsl
|
2023-09-30 19:59:08 +08:00
|
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
|
3. Changes in SAPI modules
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
2009-01-29 01:23:28 +08:00
|
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
|
4. Deprecated Functionality
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
2009-01-29 01:23:28 +08:00
|
|
|
|
|
2024-03-14 04:40:26 +08:00
|
|
|
|
- Core:
|
|
|
|
|
. Implicitly nullable parameter types are now deprecated.
|
|
|
|
|
RFC: https://wiki.php.net/rfc/deprecate-implicitly-nullable-types
|
|
|
|
|
|
2024-01-10 17:41:24 +08:00
|
|
|
|
- Curl:
|
|
|
|
|
. The CURLOPT_BINARYTRANSFER constant is deprecated.
|
|
|
|
|
|
2023-11-19 05:37:11 +08:00
|
|
|
|
- Date:
|
|
|
|
|
. Calling DatePeriod::__construct(string $isostr, int $options = 0) is
|
|
|
|
|
deprecated. Use DatePeriod::createFromISO8601String() instead.
|
|
|
|
|
|
2023-11-19 05:55:52 +08:00
|
|
|
|
- Intl:
|
|
|
|
|
. Calling intlcal_set() as well as calling IntlCalendar::set() with
|
|
|
|
|
more than 2 arguments is deprecated. Use either IntlCalendar::setDate()
|
|
|
|
|
or IntlCalendar::setDateTime() instead.
|
2023-11-19 06:21:55 +08:00
|
|
|
|
. Calling intlgregcal_create_instance() as well as calling
|
|
|
|
|
IntlGregorianCalendar::__construct() with more than 2 arguments is
|
|
|
|
|
deprecated. Use either IntlGregorianCalendar::createFromDate() or
|
|
|
|
|
IntlGregorianCalendar::createFromDateTime() instead.
|
|
|
|
|
|
2023-11-20 00:21:11 +08:00
|
|
|
|
- LDAP:
|
|
|
|
|
. Calling ldap_connect() with more than 2 arguments is deprecated. Use
|
|
|
|
|
ldap_connect_wallet() instead.
|
2023-11-20 00:42:54 +08:00
|
|
|
|
. Calling ldap_exop() with more than 4 arguments is deprecated. Use
|
|
|
|
|
ldap_exop_sync() instead.
|
2023-11-20 00:21:11 +08:00
|
|
|
|
|
2023-11-20 03:57:18 +08:00
|
|
|
|
- PgSQL:
|
|
|
|
|
. Calling pgsql_fetch_result() with 2 arguments is deprecated. Use the
|
|
|
|
|
3-parameter signature with a null $row parameter instead.
|
|
|
|
|
. Calling pg_field_prtlen() with 2 arguments is deprecated. Use the
|
|
|
|
|
3-parameter signature with a null $row parameter instead.
|
|
|
|
|
. Calling pg_field_is_null() with 2 arguments is deprecated. Use the
|
|
|
|
|
3-parameter signature with a null $row parameter instead.
|
|
|
|
|
|
2023-11-20 18:34:40 +08:00
|
|
|
|
- Reflection:
|
|
|
|
|
. Calling ReflectionMethod::__construct() with 1 argument is deprecated.
|
|
|
|
|
Use ReflectionMethod::createFromMethodName() instead.
|
|
|
|
|
|
2023-11-23 06:02:25 +08:00
|
|
|
|
- Session:
|
|
|
|
|
. Calling session_set_save_handler() with more than 2 arguments is
|
|
|
|
|
deprecated. Use the 2-parameter signature instead.
|
|
|
|
|
|
2023-11-24 21:57:23 +08:00
|
|
|
|
- Standard:
|
|
|
|
|
. Calling stream_context_set_option() with 2 arguments is deprecated.
|
|
|
|
|
Use stream_context_set_options() instead.
|
|
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
|
5. Changed Functions
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
2009-06-24 03:40:31 +08:00
|
|
|
|
|
2024-01-18 00:15:55 +08:00
|
|
|
|
- Core:
|
|
|
|
|
. trigger_error() and user_error() now have a return type of true instead of
|
|
|
|
|
bool.
|
|
|
|
|
|
2023-12-17 02:06:56 +08:00
|
|
|
|
- DOM:
|
|
|
|
|
. DOMDocument::registerNodeClass() now has a tentative return type of true.
|
|
|
|
|
Previously, the return type was bool but only true could be returned in practice.
|
|
|
|
|
|
2024-03-02 19:04:22 +08:00
|
|
|
|
- Gettext:
|
2024-03-13 04:24:16 +08:00
|
|
|
|
. bind_textdomain_codeset, textdomain and d(*)gettext functions now throw an exception
|
|
|
|
|
if the domain argument is empty.
|
2024-03-02 19:04:22 +08:00
|
|
|
|
|
2024-03-10 03:02:50 +08:00
|
|
|
|
- Hash:
|
|
|
|
|
. Changed the return type of hash_update() to true. It was already the case that only
|
|
|
|
|
true could be returned, but the stub was not updated yet.
|
|
|
|
|
|
2023-12-05 06:00:17 +08:00
|
|
|
|
- Intl:
|
|
|
|
|
. IntlDateFormatter::__construct() throws a ValueError if the locale is invalid.
|
|
|
|
|
. NumberFormatter::__construct() throws a ValueError if the locale is invalid.
|
2023-12-21 20:28:05 +08:00
|
|
|
|
. NumberFormatter::ROUND_TOWARD_ZERO and NumberFormatter::ROUND_AWAY_FROM_ZERO
|
|
|
|
|
have been added as aliases for NumberFormatter::ROUND_DOWN and
|
|
|
|
|
NumberFormatter::ROUND_UP to be consistent with the new PHP_ROUND_* modes.
|
|
|
|
|
RFC: https://wiki.php.net/rfc/new_rounding_modes_to_round_function
|
2024-02-27 01:03:17 +08:00
|
|
|
|
. ResourceBundle::get() now has a tentative return type of:
|
|
|
|
|
ResourceBundle|array|string|int|null
|
2023-12-05 06:00:17 +08:00
|
|
|
|
|
2023-10-24 03:59:08 +08:00
|
|
|
|
- MBString:
|
|
|
|
|
. The behavior of mb_strcut is more consistent now on invalid UTF-8 and UTF-16
|
|
|
|
|
strings. (For valid UTF-8 and UTF-16 strings, there is no change.)
|
|
|
|
|
|
2023-12-20 07:14:53 +08:00
|
|
|
|
- OpenSSL:
|
|
|
|
|
. The extra_attributes parameter in openssl_csr_new sets CSR attributes
|
|
|
|
|
instead of subject DN which was incorrectly done previously.
|
2023-12-21 00:11:30 +08:00
|
|
|
|
. The dn parameter in openssl_csr_new allows setting array of values for
|
|
|
|
|
a single entry.
|
2023-12-23 06:26:49 +08:00
|
|
|
|
. New serial_hex parameter added to openssl_csr_sign to allow setting serial
|
|
|
|
|
number in the hexadecimal format.
|
2023-12-20 07:14:53 +08:00
|
|
|
|
|
2024-01-08 05:16:26 +08:00
|
|
|
|
- Output:
|
|
|
|
|
. Output handler status flags passed to the flags parameter of ob_start
|
|
|
|
|
are now cleared.
|
|
|
|
|
|
2023-12-05 00:05:30 +08:00
|
|
|
|
- PDO:
|
|
|
|
|
. getAttribute, enabled to get the value of ATTR_STRINGIFY_FETCHES.
|
|
|
|
|
|
|
|
|
|
- PDO_FIREBIRD:
|
|
|
|
|
. getAttribute, enabled to get values of FB_ATTR_DATE_FORMAT, FB_ATTR_TIME_FORMAT,
|
|
|
|
|
FB_ATTR_TIMESTAMP_FORMAT.
|
2023-12-08 01:34:55 +08:00
|
|
|
|
. Added new attributes to specify transaction isolation level and access mode.
|
|
|
|
|
Along with these, five constants (PDO::FB_TRANSACTION_ISOLATION_LEVEL,
|
|
|
|
|
PDO::FB_READ_COMMITTED, PDO::FB_REPEATABLE_READ, PDO::FB_SERIALIZABLE,
|
|
|
|
|
PDO::FB_WRITABLE_TRANSACTION) have been added.
|
2023-12-20 23:37:39 +08:00
|
|
|
|
. When using persistent connections, there is now a liveness check in the
|
|
|
|
|
constructor.
|
2023-12-05 00:05:30 +08:00
|
|
|
|
|
|
|
|
|
- PDO_MYSQL:
|
|
|
|
|
. getAttribute, enabled to get the value of ATTR_FETCH_TABLE_NAMES.
|
|
|
|
|
|
2023-10-09 01:26:02 +08:00
|
|
|
|
- PGSQL:
|
|
|
|
|
. pg_select, the conditions arguments accepts an empty array and is optional.
|
|
|
|
|
|
2024-01-15 18:09:38 +08:00
|
|
|
|
- SPL:
|
|
|
|
|
. SplPriorityQueue::insert() and SplPriorityQueue::recoverFromCorruption()
|
|
|
|
|
now has a tentative return type of true
|
|
|
|
|
. SplHeap::insert() and SplHeap::recoverFromCorruption()
|
|
|
|
|
now has a tentative return type of true instead of bool
|
|
|
|
|
|
2023-09-20 00:05:05 +08:00
|
|
|
|
- Standard:
|
|
|
|
|
. 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.
|
2023-10-06 20:27:01 +08:00
|
|
|
|
. The default value of the 'cost' option for PASSWORD_BCRYPT for password_hash()
|
|
|
|
|
has been increased from '10' to '12'.
|
|
|
|
|
|
|
|
|
|
RFC: https://wiki.php.net/rfc/bcrypt_cost_2023
|
2023-12-21 20:28:05 +08:00
|
|
|
|
. Four new modes have been added to the round() function: PHP_ROUND_CEILING,
|
|
|
|
|
PHP_ROUND_FLOOR, PHP_ROUND_TOWARD_ZERO, PHP_ROUND_AWAY_FROM_ZERO.
|
|
|
|
|
|
|
|
|
|
RFC: https://wiki.php.net/rfc/new_rounding_modes_to_round_function
|
2024-01-12 08:33:14 +08:00
|
|
|
|
. debug_zval_dump() now indicates whether an array is packed.
|
2024-02-03 21:23:02 +08:00
|
|
|
|
. 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.
|
2024-02-17 01:31:21 +08:00
|
|
|
|
. long2ip() now returns string instead of string|false.
|
2024-02-23 00:12:34 +08:00
|
|
|
|
. The maximum precision that can be handled by round() has been extended by
|
|
|
|
|
one digit.
|
2024-02-01 04:23:14 +08:00
|
|
|
|
. output_add_rewrite_var() now uses url_rewriter.hosts instead of
|
|
|
|
|
session.trans_sid_hosts for selecting hosts that will be rewritten.
|
2023-09-20 00:05:05 +08:00
|
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
|
6. New Functions
|
2022-09-05 02:59:26 +08:00
|
|
|
|
========================================
|
2022-09-05 02:52:21 +08:00
|
|
|
|
|
2023-09-09 07:14:26 +08:00
|
|
|
|
- DOM:
|
|
|
|
|
. Added DOMNode::compareDocumentPosition().
|
2024-01-13 07:00:26 +08:00
|
|
|
|
. Added DOMXPath::registerPhpFunctionNS().
|
|
|
|
|
RFC: https://wiki.php.net/rfc/improve_callbacks_dom_and_xsl
|
2024-02-23 03:32:32 +08:00
|
|
|
|
. Added DOMXPath::quote() to quote a string for use in an XPath expression.
|
|
|
|
|
Example usage: "//span[contains(text()," . $xpath->quote($string) . ")]"
|
2023-09-09 07:14:26 +08:00
|
|
|
|
|
2024-02-22 00:24:27 +08:00
|
|
|
|
- Intl:
|
|
|
|
|
. Added IntlDateFormatter::getIanaID()/intltz_get_iana_id() to
|
|
|
|
|
the IANA identifier from a given timezone.
|
|
|
|
|
|
2023-11-24 18:47:32 +08:00
|
|
|
|
- MBString:
|
|
|
|
|
. Added mb_trim, mb_ltrim and mb_rtrim functions.
|
|
|
|
|
RFC: https://wiki.php.net/rfc/mb_trim
|
2024-03-21 00:25:19 +08:00
|
|
|
|
. Added mb_ucfirst and mb_lcfirst functions.
|
|
|
|
|
RFC: https://wiki.php.net/rfc/mb_ucfirst
|
2023-11-24 18:47:32 +08:00
|
|
|
|
|
2023-11-17 03:36:34 +08:00
|
|
|
|
- Opcache:
|
|
|
|
|
. If JIT is enabled, PHP will now exit with a fatal error on startup in case
|
|
|
|
|
of JIT startup initialization issues.
|
|
|
|
|
|
2023-12-07 08:31:42 +08:00
|
|
|
|
- Sodium:
|
|
|
|
|
. Added the sodium_crypto_aead_aegis128l_*() and sodium_crypto_aead_aegis256l_*()
|
|
|
|
|
functions to support the AEGIS family of authenticated encryption algorithms,
|
|
|
|
|
that was introduced in libsodium 1.0.19.
|
|
|
|
|
. sodium_crypto_aead_aes256gcm_*() functions are now enabled on aarch64 CPUs
|
|
|
|
|
with the ARM cryptographic extensions.
|
|
|
|
|
|
2024-03-01 00:41:09 +08:00
|
|
|
|
- Standard:
|
|
|
|
|
. Added the http_get_last_response_headers() and
|
|
|
|
|
http_clear_last_response_headers() that allows retrieving the same content
|
|
|
|
|
as the magic $http_response_header variable.
|
|
|
|
|
|
2024-01-13 07:00:26 +08:00
|
|
|
|
- XSL:
|
|
|
|
|
. Added XSLTProcessor::registerPhpFunctionNS().
|
|
|
|
|
RFC: https://wiki.php.net/rfc/improve_callbacks_dom_and_xsl
|
|
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
|
7. New Classes and Interfaces
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
2009-01-29 01:23:28 +08:00
|
|
|
|
|
2024-03-09 23:56:00 +08:00
|
|
|
|
- DOM:
|
|
|
|
|
. Implemented DOM HTML5 parsing and serialization.
|
|
|
|
|
RFC: https://wiki.php.net/rfc/domdocument_html5_parser.
|
|
|
|
|
This RFC adds the new DOM namespace along with new classes and
|
|
|
|
|
constant aliases.
|
|
|
|
|
There are two new classes to handle HTML and XML documents:
|
|
|
|
|
DOM\HTMLDocument and DOM\XMLDocument.
|
|
|
|
|
These classes provide a cleaner API to handle HTML and XML documents.
|
|
|
|
|
Furthermore, the DOM\HTMLDocument class implements spec-compliant HTML5
|
|
|
|
|
parsing and serialization.
|
|
|
|
|
. Implemented opt-in ext/dom spec compliance RFC.
|
|
|
|
|
This adds new classes in the DOM namespace that correspond to modern
|
|
|
|
|
equivalents to the old DOM classes in the global namespaces.
|
|
|
|
|
The new classes follow the DOM living spec.
|
|
|
|
|
RFC: https://wiki.php.net/rfc/opt_in_dom_spec_compliance
|
|
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
2015-02-10 15:56:18 +08:00
|
|
|
|
8. Removed Extensions and SAPIs
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
2009-01-29 01:23:28 +08:00
|
|
|
|
|
2024-01-22 20:56:05 +08:00
|
|
|
|
- IMAP:
|
|
|
|
|
. The IMAP extension has been unbundled and moved to PECL.
|
|
|
|
|
RFC: https://wiki.php.net/rfc/unbundle_imap_pspell_oci8
|
|
|
|
|
|
2024-01-17 19:21:08 +08:00
|
|
|
|
- PSpell:
|
|
|
|
|
. The pspell extension has been unbundled and moved to PECL.
|
|
|
|
|
RFC: https://wiki.php.net/rfc/unbundle_imap_pspell_oci8
|
|
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
|
9. Other Changes to Extensions
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
2016-07-03 18:43:30 +08:00
|
|
|
|
|
2024-01-31 21:48:17 +08:00
|
|
|
|
- Curl:
|
|
|
|
|
. The Curl extension now requires at least libcurl 7.61.0.
|
|
|
|
|
|
2023-10-29 17:50:16 +08:00
|
|
|
|
- Intl:
|
|
|
|
|
. The class constants are typed now.
|
|
|
|
|
|
2024-02-25 10:37:08 +08:00
|
|
|
|
- Intl:
|
|
|
|
|
. The OpenSSL extension now requires at least OpenSSL 1.1.1.
|
|
|
|
|
|
2023-10-29 17:43:19 +08:00
|
|
|
|
- PDO:
|
2023-10-07 20:14:57 +08:00
|
|
|
|
. The class constants are typed now.
|
|
|
|
|
|
2023-10-28 15:47:19 +08:00
|
|
|
|
- Reflection:
|
|
|
|
|
. The class constants are typed now.
|
|
|
|
|
|
2023-10-29 17:43:19 +08:00
|
|
|
|
- Spl:
|
|
|
|
|
. The class constants are typed now.
|
|
|
|
|
|
2023-10-29 17:53:07 +08:00
|
|
|
|
- Sqlite:
|
|
|
|
|
. The class constants are typed now.
|
|
|
|
|
|
2024-03-06 03:50:54 +08:00
|
|
|
|
- XMLReader:
|
|
|
|
|
. The class constants are typed now.
|
|
|
|
|
|
2023-11-24 20:37:08 +08:00
|
|
|
|
- XSL:
|
|
|
|
|
. The typed properties XSLTProcessor::$cloneDocument and
|
|
|
|
|
XSLTProcessor::$doXInclude are now declared.
|
|
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
|
10. New Global Constants
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
2010-03-25 00:23:50 +08:00
|
|
|
|
|
2024-01-04 23:05:49 +08:00
|
|
|
|
- Core:
|
|
|
|
|
. PHP_OUTPUT_HANDLER_PROCESSED.
|
|
|
|
|
|
2023-09-21 12:51:52 +08:00
|
|
|
|
- Intl:
|
|
|
|
|
. The IntlDateFormatter class exposes now the new PATTERN constant
|
|
|
|
|
reflecting udat api's UDAT_PATTERN.
|
2024-02-22 00:24:27 +08:00
|
|
|
|
. The IntlChar class exposes now the new PROPERTY_IDS_UNARY_OPERATOR (new
|
2024-02-22 07:23:09 +08:00
|
|
|
|
IDS binary operator), PROPERTY_ID_COMPAT_MATH_START,
|
|
|
|
|
PROPERTY_ID_COMPAT_MATH_CONTINUE (both for mathematical
|
2024-02-22 00:24:27 +08:00
|
|
|
|
identifier profiling purpose) constants.
|
2023-09-21 12:51:52 +08:00
|
|
|
|
|
2024-02-16 02:53:45 +08:00
|
|
|
|
- LDAP:
|
|
|
|
|
. LDAP_OPT_X_TLS_PROTOCOL_MAX.
|
|
|
|
|
. LDAP_OPT_X_TLS_PROTOCOL_TLS1_3.
|
|
|
|
|
|
2024-02-26 04:03:37 +08:00
|
|
|
|
- LibXML:
|
|
|
|
|
. LIBXML_RECOVER.
|
|
|
|
|
|
2024-01-15 01:10:12 +08:00
|
|
|
|
- OpenSSL:
|
|
|
|
|
. X509_PURPOSE_OCSP_HELPER.
|
|
|
|
|
. X509_PURPOSE_TIMESTAMP_SIGN.
|
|
|
|
|
|
2024-01-13 00:51:58 +08:00
|
|
|
|
- Standard:
|
|
|
|
|
. PHP_ROUND_CEILING.
|
|
|
|
|
. PHP_ROUND_FLOOR.
|
|
|
|
|
. PHP_ROUND_TOWARD_ZERO.
|
|
|
|
|
. PHP_ROUND_AWAY_FROM_ZERO.
|
|
|
|
|
|
2023-12-26 23:20:13 +08:00
|
|
|
|
- Sockets:
|
|
|
|
|
. SO_EXCLUSIVEADDRUSE (Windows only).
|
2024-03-16 21:34:40 +08:00
|
|
|
|
. SOCK_CONN_DGRAM (NetBSD only).
|
|
|
|
|
. SOCK_DCCP (NetBSD only).
|
2023-12-26 23:20:13 +08:00
|
|
|
|
|
2024-03-12 05:16:22 +08:00
|
|
|
|
- Sodium:
|
|
|
|
|
. SODIUM_CRYPTO_AEAD_AEGIS128L_KEYBYTES
|
|
|
|
|
. SODIUM_CRYPTO_AEAD_AEGIS128L_NSECBYTES
|
|
|
|
|
. SODIUM_CRYPTO_AEAD_AEGIS128L_NPUBBYTES
|
|
|
|
|
. SODIUM_CRYPTO_AEAD_AEGIS128L_ABYTES
|
|
|
|
|
. SODIUM_CRYPTO_AEAD_AEGIS256_KEYBYTES
|
|
|
|
|
. SODIUM_CRYPTO_AEAD_AEGIS256_NSECBYTES
|
|
|
|
|
. SODIUM_CRYPTO_AEAD_AEGIS256_NPUBBYTES
|
|
|
|
|
. SODIUM_CRYPTO_AEAD_AEGIS256_ABYTES
|
|
|
|
|
|
2023-10-22 22:44:49 +08:00
|
|
|
|
- XML:
|
|
|
|
|
. Added XML_OPTION_PARSE_HUGE to allow large inputs in xml_parse and
|
|
|
|
|
xml_parse_into_struct.
|
|
|
|
|
RFC: https://wiki.php.net/rfc/xml_option_parse_huge.
|
|
|
|
|
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
2014-05-01 18:27:38 +08:00
|
|
|
|
11. Changes to INI File Handling
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
2010-08-30 17:38:47 +08:00
|
|
|
|
|
2014-08-22 19:35:07 +08:00
|
|
|
|
========================================
|
|
|
|
|
12. Windows Support
|
|
|
|
|
========================================
|
|
|
|
|
|
2019-01-15 17:13:39 +08:00
|
|
|
|
========================================
|
2019-01-28 17:34:31 +08:00
|
|
|
|
13. Other Changes
|
2012-03-06 04:14:04 +08:00
|
|
|
|
========================================
|
2018-12-27 05:26:01 +08:00
|
|
|
|
|
|
|
|
|
========================================
|
2019-01-28 17:34:31 +08:00
|
|
|
|
14. Performance Improvements
|
2018-12-27 05:26:01 +08:00
|
|
|
|
========================================
|
2023-06-20 00:46:05 +08:00
|
|
|
|
|
2023-09-23 00:46:18 +08:00
|
|
|
|
* The performance of DOMNode::C14N() is greatly improved for the case without
|
|
|
|
|
an xpath query. This can give a time improvement of easily two order of
|
|
|
|
|
magnitude for documents with tens of thousands of nodes.
|
2023-10-13 23:31:24 +08:00
|
|
|
|
|
2023-11-04 22:20:49 +08:00
|
|
|
|
* The performance of strspn() and strcspn() is greatly improved.
|
|
|
|
|
They now run in linear time instead of being bounded by quadratic time.
|
2023-10-24 03:59:08 +08:00
|
|
|
|
|
2024-03-06 03:54:38 +08:00
|
|
|
|
* Improved the performance of strpbrk().
|
|
|
|
|
|
2023-10-24 03:59:08 +08:00
|
|
|
|
* mb_strcut() is much faster now for UTF-8 and UTF-16 strings.
|
2023-11-12 01:44:17 +08:00
|
|
|
|
|
2023-11-18 02:38:43 +08:00
|
|
|
|
* Looking up mbstring encoding names is much faster now.
|
2023-11-24 20:37:08 +08:00
|
|
|
|
|
|
|
|
|
* The performance of converting SJIS-win to unicode is greatly improved.
|
|
|
|
|
|
|
|
|
|
* get_browser() is much faster now, up to 1.5x - 2.5x for some test cases.
|
2024-03-08 03:26:35 +08:00
|
|
|
|
|
|
|
|
|
* Improved the performance of MySQLnd quoting.
|