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-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-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.
|
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.
|
2023-10-06 23:42:47 +08:00
|
|
|
. The typed properties XSLTProcessor::$cloneDocument and
|
|
|
|
XSLTProcessor::$doXInclude are now declared.
|
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-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.
|
2023-11-14 03:18:19 +08:00
|
|
|
. Implemented DOM HTML5 parsing and serialization.
|
|
|
|
RFC: https://wiki.php.net/rfc/domdocument_html5_parser.
|
|
|
|
This RFC adds the new DOM namespace along with class 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.
|
2023-09-09 07:14:26 +08:00
|
|
|
|
2023-10-29 01:48:01 +08:00
|
|
|
- Phar:
|
|
|
|
. Added support for the unix timestamp extension for zip archives.
|
|
|
|
|
2023-11-16 17:36:20 +08:00
|
|
|
- POSIX:
|
|
|
|
. Added constant POSIX_SC_CHILD_MAX
|
|
|
|
. Added constant POSIX_SC_CLK_TCK
|
|
|
|
|
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-09-30 19:59:08 +08:00
|
|
|
- XSL:
|
|
|
|
. It is now possible to use parameters that contain both single and double
|
|
|
|
quotes.
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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-10-09 01:26:02 +08:00
|
|
|
- PGSQL:
|
|
|
|
. pg_select, the conditions arguments accepts an empty array and is optional.
|
|
|
|
|
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-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().
|
|
|
|
|
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
|
|
|
|
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
|
|
|
|
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
|
|
|
|
2023-10-29 17:50:16 +08:00
|
|
|
- Intl:
|
|
|
|
. The class constants are typed now.
|
|
|
|
|
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.
|
|
|
|
|
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
|
|
|
|
2023-09-21 12:51:52 +08:00
|
|
|
- Intl:
|
|
|
|
. The IntlDateFormatter class exposes now the new PATTERN constant
|
|
|
|
reflecting udat api's UDAT_PATTERN.
|
|
|
|
|
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
|
|
|
|
|
|
|
* mb_strcut() is much faster now for UTF-8 and UTF-16 strings.
|
2023-11-12 01:44:17 +08:00
|
|
|
|
|
|
|
* get_browser() is much faster now, up to 1.5x - 2.5x for some test cases.
|
2023-11-18 02:38:43 +08:00
|
|
|
|
|
|
|
* Looking up mbstring encoding names is much faster now.
|