• Marketing1on1

    (@marketing1on1com)


    Getting the following errors:

    [17-Jan-2023 04:36:59 UTC] PHP Deprecated:  Implicit conversion from float 10.1 to int loses precision in /public_html/wp-includes/class-wp-hook.php on line 79
    [17-Jan-2023 04:36:59 UTC] PHP Deprecated:  Implicit conversion from float 10.1 to int loses precision in /public_html/wp-includes/class-wp-hook.php on line 77

    Here is the code that it’s flagging:

    $priority_existed = isset( $this->callbacks[ $priority ] );
    $this->callbacks[ $priority ][ $idx ] = array(

    I was able to get rid of the error by doing the following:

    $priority_existed = isset( $this->callbacks[ (int) $priority ] );
    $this->callbacks[ (int) $priority ][ $idx ] = array(

    My question is, has anyone else experienced the following error? Just trying to pin point if it’s an issue with my website or it’s a WP glitch with 8.1

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • I just installed a spanking new WP 6.1.1 on PHP 8.1, with no plugin and only the default 2023 theme. I didn’t see this specific warning message even with WP_DEBUG turned on.

    In any case, this is just a PHP deprecation warning. My guess is that there are several such cleanup works yet to be done, which is why WordPress 6.1 officially has only “Beta support” for PHP 8.0, 8.1 and 8.2 as indicated here: https://make.www.ads-software.com/core/handbook/references/php-compatibility-and-wordpress-versions/

    And a deprecation warning shouldn’t stop the site from working.

    If you were seeing this on your website, then your web server is configured to display errors on-screen, and that should be a bigger concern than the PHP deprecation warning itself.

Viewing 1 replies (of 1 total)
  • The topic ‘class-wp-hook.php Throwing Errors on PHP 8.1’ is closed to new replies.