From 888cf7026eade79675a8290e5d9518ff2c8b7fde Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 23 Oct 2024 22:58:23 +0100 Subject: [PATCH 1/6] Some fixes to the 8.4 migration guide --- appendices/migration84/incompatible.xml | 16 ++++----- appendices/migration84/other-changes.xml | 43 +++++++++++++++--------- 2 files changed, 35 insertions(+), 24 deletions(-) diff --git a/appendices/migration84/incompatible.xml b/appendices/migration84/incompatible.xml index 5eda276ae96e..d1485e19a2db 100644 --- a/appendices/migration84/incompatible.xml +++ b/appendices/migration84/incompatible.xml @@ -459,9 +459,9 @@ Some DOM methods previously returned &false; or a - PHP_ERR DOMException + DOM_PHP_ERR DOMException if a new node could not be allocated. - They now consistently throw an INVALID_STATE_ERR + They now consistently throw an DOM_INVALID_STATE_ERR DOMException. This situation is extremely unlikely and the probability of being affected is low. @@ -626,8 +626,8 @@ PDO_DBLIB - The DBLIB_ATTR_STRINGIFY_UNIQUEIDENTIFIER and - DBLIB_ATTR_DATETIME_CONVERT attributes now act as + The Pdo\Dblib::ATTR_STRINGIFY_UNIQUEIDENTIFIER and + Pdo\Dblib::ATTR_DATETIME_CONVERT attributes now act as boolean attributes instead of integer attributes. Thus setting the attribute via PDO::setAttribute and retrieving it via PDO::getAttribute expects @@ -639,7 +639,7 @@ PDO_FIREBIRD - The ATTR_AUTOCOMMIT attribute now act as + The PDO::ATTR_AUTOCOMMIT attribute now act as boolean attributes instead of integer attributes. Thus setting the attribute via PDO::setAttribute and retrieving it via PDO::getAttribute expects @@ -657,9 +657,9 @@ PDO_MYSQL - The ATTR_AUTOCOMMIT, - ATTR_EMULATE_PREPARES, and - MYSQL_ATTR_DIRECT_QUERY attributes now act as + The PDO::ATTR_AUTOCOMMIT, + PDO::ATTR_EMULATE_PREPARES, and + PDO::MYSQL_ATTR_DIRECT_QUERY attributes now act as boolean attributes instead of integer attributes. Thus setting the attribute via PDO::setAttribute and retrieving it via PDO::getAttribute expects diff --git a/appendices/migration84/other-changes.xml b/appendices/migration84/other-changes.xml index 9427ad276457..7798f9e0b258 100644 --- a/appendices/migration84/other-changes.xml +++ b/appendices/migration84/other-changes.xml @@ -371,7 +371,7 @@ The backlog parameter of - socket_create_listen( now has a default value of + socket_create_listen now has a default value of SOMAXCONN. Previously, it was 128. @@ -446,14 +446,23 @@ Rounding with <function>round</function> - The $mode parameter of the round() function has been widened to RoundingMode|int, - accepting instances of a new RoundingMode enum. + 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. + Four new modes have been added to the round function: + + RoundingMode::PositiveInfinity + RoundingMode::NegativeInfinity + RoundingMode::TowardsZero + RoundingMode::AwayFromZero + @@ -461,24 +470,26 @@ 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. + 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. + 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. + 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. @@ -617,9 +628,9 @@ Improved the performance of floating point number parsing and formatting in ZTS builds under highly concurrent loads. - This affects the printf() family of functions as well + This affects the printf family of functions as well as serialization functions such as json_encode, - or serialize(). + or serialize. @@ -642,7 +653,7 @@ DOM - The performance of DOMNode::C14N() is greatly + 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. @@ -717,7 +728,7 @@ Improved the performance of \Random\Randomizer, with a specific focus on the \Random\Randomizer::getBytes, - and getBytesFromString() methods. + and \Random\Randomizer::getBytesFromString methods. From 61073e33b0b1bca8df66459100d09a3e219d728c Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 23 Oct 2024 23:23:31 +0100 Subject: [PATCH 2/6] Fixup --- appendices/migration84/other-changes.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/appendices/migration84/other-changes.xml b/appendices/migration84/other-changes.xml index 7798f9e0b258..373f149a4949 100644 --- a/appendices/migration84/other-changes.xml +++ b/appendices/migration84/other-changes.xml @@ -455,7 +455,7 @@ - + Four new modes have been added to the round function: RoundingMode::PositiveInfinity @@ -464,7 +464,7 @@ RoundingMode::AwayFromZero - + The internal implementation for rounding to integers has been rewritten From a1b79176ee43c32fc00006f745129c069e7c8868 Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Wed, 23 Oct 2024 23:32:50 +0100 Subject: [PATCH 3/6] Drop enum case handling --- appendices/migration84/other-changes.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/appendices/migration84/other-changes.xml b/appendices/migration84/other-changes.xml index 373f149a4949..d36c8c3653dc 100644 --- a/appendices/migration84/other-changes.xml +++ b/appendices/migration84/other-changes.xml @@ -458,10 +458,10 @@ Four new modes have been added to the round function: - RoundingMode::PositiveInfinity - RoundingMode::NegativeInfinity - RoundingMode::TowardsZero - RoundingMode::AwayFromZero + RoundingMode::PositiveInfinity + RoundingMode::NegativeInfinity + RoundingMode::TowardsZero + RoundingMode::AwayFromZero From 7c8e187f511c9fcd36eb35c77c1ba56065b867ed Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 24 Oct 2024 14:10:52 +0100 Subject: [PATCH 4/6] Fix leading backslash --- appendices/migration84/deprecated.xml | 2 +- appendices/migration84/other-changes.xml | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/appendices/migration84/deprecated.xml b/appendices/migration84/deprecated.xml index b814148a037c..47391c66392b 100644 --- a/appendices/migration84/deprecated.xml +++ b/appendices/migration84/deprecated.xml @@ -337,7 +337,7 @@ class _MyClass {} lcg_value is now deprecated, as the function is broken in multiple ways. - Use \Random\Randomizer::getFloat instead. + Use Random\Randomizer::getFloat instead. diff --git a/appendices/migration84/other-changes.xml b/appendices/migration84/other-changes.xml index d36c8c3653dc..2d9e67192dac 100644 --- a/appendices/migration84/other-changes.xml +++ b/appendices/migration84/other-changes.xml @@ -725,10 +725,10 @@ Random - Improved the performance of \Random\Randomizer, + Improved the performance of Random\Randomizer, with a specific focus on the - \Random\Randomizer::getBytes, - and \Random\Randomizer::getBytesFromString methods. + Random\Randomizer::getBytes, + and Random\Randomizer::getBytesFromString methods. From 54a7727c29fff15e0a8e138a90a1604e52f14b9e Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 24 Oct 2024 14:13:00 +0100 Subject: [PATCH 5/6] Reprhase DOM error --- appendices/migration84/incompatible.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/appendices/migration84/incompatible.xml b/appendices/migration84/incompatible.xml index d1485e19a2db..6e500f2484ee 100644 --- a/appendices/migration84/incompatible.xml +++ b/appendices/migration84/incompatible.xml @@ -459,10 +459,10 @@ Some DOM methods previously returned &false; or a - DOM_PHP_ERR DOMException - if a new node could not be allocated. - They now consistently throw an DOM_INVALID_STATE_ERR - DOMException. + DOMException with code + DOM_PHP_ERR if a new node could not be allocated. + They now consistently throw a DOMException + with code DOM_INVALID_STATE_ERR. This situation is extremely unlikely and the probability of being affected is low. As a result DOMImplementation::createDocument From fa276626226d978e20cb258949187edccb0d263c Mon Sep 17 00:00:00 2001 From: Gina Peter Banyard Date: Thu, 24 Oct 2024 14:13:20 +0100 Subject: [PATCH 6/6] Add missing word --- appendices/migration84/deprecated.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appendices/migration84/deprecated.xml b/appendices/migration84/deprecated.xml index 47391c66392b..c4c8229ae0e6 100644 --- a/appendices/migration84/deprecated.xml +++ b/appendices/migration84/deprecated.xml @@ -91,7 +91,7 @@ function foo(T1 $a, ?T2 $b, T3 $c) {} This affects the exponentiation operator ** - and the pow. + and the pow function.