|
371 | 371 |
|
372 | 372 | <simpara>
|
373 | 373 | 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 |
375 | 375 | <constant>SOMAXCONN</constant>.
|
376 | 376 | Previously, it was <literal>128</literal>.
|
377 | 377 | </simpara>
|
|
446 | 446 | <title>Rounding with <function>round</function></title>
|
447 | 447 |
|
448 | 448 | <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. |
451 | 455 | <!-- RFC: https://wiki.php.net/rfc/correctly_name_the_rounding_mode_and_make_it_an_enum -->
|
452 | 456 | </simpara>
|
453 | 457 |
|
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> |
457 | 466 | <!-- RFC: https://wiki.php.net/rfc/new_rounding_modes_to_round_function -->
|
458 |
| - </simpara> |
| 467 | + </para> |
459 | 468 |
|
460 | 469 | <simpara>
|
461 | 470 | The internal implementation for rounding to integers has been rewritten
|
462 | 471 | to be easier to verify for correctness and to be easier to maintain.
|
463 | 472 | 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>. |
466 | 476 | Additional inputs might also be affected and result in different outputs
|
467 | 477 | compared to earlier PHP versions.
|
468 | 478 | </simpara>
|
469 | 479 |
|
470 | 480 | <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>. |
474 | 485 | However, "pre-rounding" incorrectly rounds certain numbers,
|
475 | 486 | so this fix removes "pre-rounding" and changes the way numbers are compared,
|
476 | 487 | so that the values are correctly rounded as decimal numbers.
|
477 | 488 | </simpara>
|
478 | 489 |
|
479 | 490 | <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. |
482 | 493 | For example, <code>round(4503599627370495.5)</code> returned in
|
483 | 494 | <literal>4503599627370495.5</literal>,
|
484 | 495 | but now returns <literal>4503599627370496</literal>.
|
|
617 | 628 | <simpara>
|
618 | 629 | Improved the performance of floating point number parsing and formatting in
|
619 | 630 | 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 |
621 | 632 | as serialization functions such as <function>json_encode</function>,
|
622 |
| - or <function>serialize()</function>. |
| 633 | + or <function>serialize</function>. |
623 | 634 | </simpara>
|
624 | 635 |
|
625 | 636 | <simpara>
|
|
642 | 653 | <title>DOM</title>
|
643 | 654 |
|
644 | 655 | <simpara>
|
645 |
| - The performance of <methodname>DOMNode::C14N()</methodname> is greatly |
| 656 | + The performance of <methodname>DOMNode::C14N</methodname> is greatly |
646 | 657 | improved for the case without an xpath query.
|
647 | 658 | This can give a time improvement of easily two order of
|
648 | 659 | magnitude for documents with tens of thousands of nodes.
|
|
714 | 725 | <title>Random</title>
|
715 | 726 |
|
716 | 727 | <simpara>
|
717 |
| - Improved the performance of <classname>\Random\Randomizer</classname>, |
| 728 | + Improved the performance of <classname>Random\Randomizer</classname>, |
718 | 729 | 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. |
721 | 732 | </simpara>
|
722 | 733 | </sect3>
|
723 | 734 |
|
|
0 commit comments