Skip to content

Commit b1b0396

Browse files
authored
Some fixes to the 8.4 migration guide (#3910)
1 parent 8b2eba9 commit b1b0396

File tree

3 files changed

+43
-32
lines changed

3 files changed

+43
-32
lines changed

appendices/migration84/deprecated.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function foo(T1 $a, ?T2 $b, T3 $c) {}
9191

9292
<simpara>
9393
This affects the exponentiation operator <literal>**</literal>
94-
and the <function>pow</function>.
94+
and the <function>pow</function> function.
9595
</simpara>
9696

9797
<simpara>
@@ -337,7 +337,7 @@ class _MyClass {}
337337
<simpara>
338338
<function>lcg_value</function> is now deprecated,
339339
as the function is broken in multiple ways.
340-
Use <methodname>\Random\Randomizer::getFloat</methodname> instead.
340+
Use <methodname>Random\Randomizer::getFloat</methodname> instead.
341341
</simpara>
342342
</sect2>
343343

appendices/migration84/incompatible.xml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,10 @@
459459

460460
<simpara>
461461
Some DOM methods previously returned &false; or a
462-
<constant>PHP_ERR</constant> <exceptionname>DOMException</exceptionname>
463-
if a new node could not be allocated.
464-
They now consistently throw an <constant>INVALID_STATE_ERR</constant>
465-
<exceptionname>DOMException</exceptionname>.
462+
<exceptionname>DOMException</exceptionname> with code
463+
<constant>DOM_PHP_ERR</constant> if a new node could not be allocated.
464+
They now consistently throw a <exceptionname>DOMException</exceptionname>
465+
with code <constant>DOM_INVALID_STATE_ERR</constant>.
466466
This situation is extremely unlikely and the probability of being affected
467467
is low.
468468
As a result <methodname>DOMImplementation::createDocument</methodname>
@@ -626,8 +626,8 @@
626626
<title>PDO_DBLIB</title>
627627

628628
<simpara>
629-
The <constant>DBLIB_ATTR_STRINGIFY_UNIQUEIDENTIFIER</constant> and
630-
<constant>DBLIB_ATTR_DATETIME_CONVERT</constant> attributes now act as
629+
The <constant>Pdo\Dblib::ATTR_STRINGIFY_UNIQUEIDENTIFIER</constant> and
630+
<constant>Pdo\Dblib::ATTR_DATETIME_CONVERT</constant> attributes now act as
631631
boolean attributes instead of integer attributes.
632632
Thus setting the attribute via <methodname>PDO::setAttribute</methodname>
633633
and retrieving it via <methodname>PDO::getAttribute</methodname> expects
@@ -639,7 +639,7 @@
639639
<title>PDO_FIREBIRD</title>
640640

641641
<simpara>
642-
The <constant>ATTR_AUTOCOMMIT</constant> attribute now act as
642+
The <constant>PDO::ATTR_AUTOCOMMIT</constant> attribute now act as
643643
boolean attributes instead of integer attributes.
644644
Thus setting the attribute via <methodname>PDO::setAttribute</methodname>
645645
and retrieving it via <methodname>PDO::getAttribute</methodname> expects
@@ -657,9 +657,9 @@
657657
<title>PDO_MYSQL</title>
658658

659659
<simpara>
660-
The <constant>ATTR_AUTOCOMMIT</constant>,
661-
<constant>ATTR_EMULATE_PREPARES</constant>, and
662-
<constant>MYSQL_ATTR_DIRECT_QUERY</constant> attributes now act as
660+
The <constant>PDO::ATTR_AUTOCOMMIT</constant>,
661+
<constant>PDO::ATTR_EMULATE_PREPARES</constant>, and
662+
<constant>PDO::MYSQL_ATTR_DIRECT_QUERY</constant> attributes now act as
663663
boolean attributes instead of integer attributes.
664664
Thus setting the attribute via <methodname>PDO::setAttribute</methodname>
665665
and retrieving it via <methodname>PDO::getAttribute</methodname> expects

appendices/migration84/other-changes.xml

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@
371371

372372
<simpara>
373373
The <parameter>backlog</parameter> parameter of
374-
<function>socket_create_listen(</function> now has a default value of
374+
<function>socket_create_listen</function> now has a default value of
375375
<constant>SOMAXCONN</constant>.
376376
Previously, it was <literal>128</literal>.
377377
</simpara>
@@ -446,39 +446,50 @@
446446
<title>Rounding with <function>round</function></title>
447447

448448
<simpara>
449-
The $mode parameter of the round() function has been widened to RoundingMode|int,
450-
accepting instances of a new RoundingMode enum.
449+
The <parameter>mode</parameter> parameter of the
450+
<function>round</function> function has been widened to
451+
<!-- TODO Proper union type -->
452+
<literal>RoundingMode|int</literal>,
453+
<!-- TODO should be <enumname> ? -->
454+
accepting instances of a new <classname>RoundingMode</classname> enum.
451455
<!-- RFC: https://wiki.php.net/rfc/correctly_name_the_rounding_mode_and_make_it_an_enum -->
452456
</simpara>
453457

454-
<simpara>
455-
Four new modes have been added to the round() function: RoundingMode::PositiveInfinity,
456-
RoundingMode::NegativeInfinity, RoundingMode::TowardsZero, RoundingMode::AwayFromZero.
458+
<para>
459+
Four new modes have been added to the <function>round</function> function:
460+
<simplelist type="inline">
461+
<member><!-- <enumidentifier> -->RoundingMode::PositiveInfinity<!-- </enumidentifier> --></member>
462+
<member><!-- <enumidentifier> -->RoundingMode::NegativeInfinity<!-- </enumidentifier> --></member>
463+
<member><!-- <enumidentifier> -->RoundingMode::TowardsZero<!-- </enumidentifier> --></member>
464+
<member><!-- <enumidentifier> -->RoundingMode::AwayFromZero<!-- </enumidentifier> --></member>
465+
</simplelist>
457466
<!-- RFC: https://wiki.php.net/rfc/new_rounding_modes_to_round_function -->
458-
</simpara>
467+
</para>
459468

460469
<simpara>
461470
The internal implementation for rounding to integers has been rewritten
462471
to be easier to verify for correctness and to be easier to maintain.
463472
Some rounding bugs have been fixed as a result of the rewrite.
464-
For example previously rounding 0.49999999999999994 to the nearest integer
465-
would have resulted in 1.0 instead of the correct result 0.0.
473+
For example previously rounding <literal>0.49999999999999994</literal>
474+
to the nearest integer would have resulted in <literal>1.0</literal>
475+
instead of the correct result <literal>0.0</literal>.
466476
Additional inputs might also be affected and result in different outputs
467477
compared to earlier PHP versions.
468478
</simpara>
469479

470480
<simpara>
471-
Fixed a bug caused by "pre-rounding" of the round() function.
472-
Previously, using "pre-rounding" to treat a value like 0.285
473-
(actually 0.28499999999999998) as a decimal number and round it to 0.29.
481+
Fixed a bug caused by "pre-rounding" of the <function>round</function> function.
482+
Previously, using "pre-rounding" to treat a value like <literal>0.285</literal>
483+
(actually <literal>0.28499999999999998</literal>) as a decimal number
484+
and round it to <literal>0.29</literal>.
474485
However, "pre-rounding" incorrectly rounds certain numbers,
475486
so this fix removes "pre-rounding" and changes the way numbers are compared,
476487
so that the values are correctly rounded as decimal numbers.
477488
</simpara>
478489

479490
<simpara>
480-
The maximum precision that can be handled by round() has been extended
481-
by one digit.
491+
The maximum precision that can be handled by <function>round</function>
492+
has been extended by one digit.
482493
For example, <code>round(4503599627370495.5)</code> returned in
483494
<literal>4503599627370495.5</literal>,
484495
but now returns <literal>4503599627370496</literal>.
@@ -617,9 +628,9 @@
617628
<simpara>
618629
Improved the performance of floating point number parsing and formatting in
619630
ZTS builds under highly concurrent loads.
620-
This affects the <function>printf()</function> family of functions as well
631+
This affects the <function>printf</function> family of functions as well
621632
as serialization functions such as <function>json_encode</function>,
622-
or <function>serialize()</function>.
633+
or <function>serialize</function>.
623634
</simpara>
624635

625636
<simpara>
@@ -642,7 +653,7 @@
642653
<title>DOM</title>
643654

644655
<simpara>
645-
The performance of <methodname>DOMNode::C14N()</methodname> is greatly
656+
The performance of <methodname>DOMNode::C14N</methodname> is greatly
646657
improved for the case without an xpath query.
647658
This can give a time improvement of easily two order of
648659
magnitude for documents with tens of thousands of nodes.
@@ -714,10 +725,10 @@
714725
<title>Random</title>
715726

716727
<simpara>
717-
Improved the performance of <classname>\Random\Randomizer</classname>,
728+
Improved the performance of <classname>Random\Randomizer</classname>,
718729
with a specific focus on the
719-
<methodname>\Random\Randomizer::getBytes</methodname>,
720-
and <methodname>getBytesFromString()</methodname> methods.
730+
<methodname>Random\Randomizer::getBytes</methodname>,
731+
and <methodname>Random\Randomizer::getBytesFromString</methodname> methods.
721732
</simpara>
722733
</sect3>
723734

0 commit comments

Comments
 (0)