[wp-trac] [WordPress Trac] #55656: PHP 8.x: various compatibility fixes for WordPress 6.1

WordPress Trac noreply at wordpress.org
Wed Jun 22 14:54:04 UTC 2022


#55656: PHP 8.x: various compatibility fixes for WordPress 6.1
-------------------------------------------------+-------------------------
 Reporter:  hellofromTonya                       |       Owner:  (none)
     Type:  task (blessed)                       |      Status:  new
 Priority:  normal                               |   Milestone:  6.1
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  php8 php81 has-patch has-unit-tests  |     Focuses:  coding-
                                                 |  standards
-------------------------------------------------+-------------------------

Comment (by SergeyBiryukov):

 In [changeset:"53555" 53555]:
 {{{
 #!CommitTicketReference repository="" revision="53555"
 Code Modernization: Use the integer portion of an item position in
 `add_submenu_page()`.

 This fixes an `Implicit conversion from float to int loses precision` PHP
 8.1 deprecation notice when adding a new admin menu item with a `float`
 value passed as the `$position` parameter.

 This change is covered by existing unit tests and addresses 8 errors when
 running the test suite on PHP 8.1.

 References:
 * [https://php.watch/versions/8.1/deprecate-implicit-conversion-
 incompatible-float-string PHP 8.1: Implicit incompatible float to int
 conversion is deprecated]
 * [https://wiki.php.net/rfc/implicit-float-int-deprecate PHP RFC:
 Deprecate implicit non-integer-compatible float to int conversions]

 Follow-up to [52569], [53104].

 Props jrf.
 See #55656, #54798.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/55656#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list