[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
Sun Nov 27 22:36:09 UTC 2022


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

 * keywords:  needs-patch php81 => php81 close


Comment:

 Thanks @roadlink for reporting this.

 Unfortunately, there is nothing which can be done without a backtrace of
 the notice.

 The notice basically tells us there is a function call to
 [https://developer.wordpress.org/reference/functions/add_filter/
 `add_filter()`] which passes `9.9` (a floating point number) as the
 `$priority`, while that parameter is only supposed to be set to an integer
 (whole number).

 No such function call exists in WP Core, so this function call to
 `add_filter()` (or `add_action()` comes from a plugin or a theme.

 Without a backtrace it is impossible to determine which plugin or theme is
 ''doing it wrong''.

 The issue should be fixed in the plugin/theme. No action should be taken
 on this in WP Core.

 You could try to figure out which plugin/theme is causing this by
 disabling them one by one until the notice is no longer being written to
 the logs.

 Once you've figured out the plugin/theme, please report it to the author
 of the plugin/theme and ask them to fix it.

 Suggest: close.

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


More information about the wp-trac mailing list