Title: class-wp-hook.php Throwing Errors on PHP 8.1
Last modified: January 17, 2023

---

# class-wp-hook.php Throwing Errors on PHP 8.1

 *  [Marketing1on1](https://wordpress.org/support/users/marketing1on1com/)
 * (@marketing1on1com)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/class-wp-hook-php-throwing-errors-on-php-8-1/)
 * 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](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fclass-wp-hook-php-throwing-errors-on-php-8-1%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [George Appiah](https://wordpress.org/support/users/gappiah/)
 * (@gappiah)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/class-wp-hook-php-throwing-errors-on-php-8-1/#post-16380041)
 * 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.wordpress.org/core/handbook/references/php-compatibility-and-wordpress-versions/](https://make.wordpress.org/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.

## Tags

 * [PHP Deprecated](https://wordpress.org/support/topic-tag/php-deprecated/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [George Appiah](https://wordpress.org/support/users/gappiah/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/class-wp-hook-php-throwing-errors-on-php-8-1/#post-16380041)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
