[wp-trac] [WordPress Trac] #57205: PHP 8.1 warning : Implicit conversion from float 9.9 to int loses precision

WordPress Trac noreply at wordpress.org
Thu Jan 19 23:38:45 UTC 2023


#57205: PHP 8.1 warning : Implicit conversion from float 9.9 to int loses precision
-------------------------------------+-----------------------
 Reporter:  roadlink                 |       Owner:  (none)
     Type:  defect (bug)             |      Status:  reopened
 Priority:  normal                   |   Milestone:
Component:  General                  |     Version:  6.1.1
 Severity:  normal                   |  Resolution:
 Keywords:  php81 reporter-feedback  |     Focuses:
-------------------------------------+-----------------------
Changes (by mcaskill):

 * status:  closed => reopened
 * resolution:  invalid =>


Comment:

 I've been encountering this deprecation warning as well in recent
 projects. As mentioned already, this stems from third-party software using
 floats as a hook priority.

 Since, historically, floats have been permitted and prior to PHP 8 were
 implicitly converted to strings, we could explicitly convert them to
 strings in order to support PHP 8+ without introducing a breaking change
 compared to this older ticket (#30875) which proposed enforcing only
 integers.

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


More information about the wp-trac mailing list