Title: Fatal Errors w/ PHP 8.1
Last modified: January 26, 2023

---

# Fatal Errors w/ PHP 8.1

 *  Resolved [minutemedia](https://wordpress.org/support/users/minutemedia/)
 * (@minutemedia)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/fatal-errors-w-php-8-1/)
 * Hi, encountering some fatal errors related to array_merge() and array_key_exists()
   usage when trying to upgrade to php 8.1 / wp 6.1. These appear to have been fixed
   in the [“pro” version of this plugin](https://www.role-editor.com/user-role-editor-pro-version-4-63-4/).
   Are there plans to release php8.1 compatibility for the free version as well?
   Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/)
 * (@shinephp)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/fatal-errors-w-php-8-1/#post-16424513)
 * Hi,
 * Can you please show error messages with file name and line number, where error
   takes place?
 * Pro version includes the exact copy of a free version. So, if I missed something,
   fix is needed for both versions.
 *  Thread Starter [minutemedia](https://wordpress.org/support/users/minutemedia/)
 * (@minutemedia)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/fatal-errors-w-php-8-1/#post-16427657)
 * Thanks for the reply- I get the following error when visiting **/wp-admin/users.
   php?page=users-user-role-editor.php**
 *     ```wp-block-code
       PHP Fatal error:  Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, int given in /www/wp-content/plugin
       s/user-role-editor/includes/classes/view.php:81
       ```
   
 * I (maybe wrongly) thought the [free version](http://wordpress.org/plugins/user-role-editor/)(
   4.63.2) was slightly behind the [pro version](https://www.role-editor.com/user-role-editor-pro-version-4-63-4/)(
   4.63.4). My version info:
 *     ```wp-block-code
       $ php -v
       PHP 8.1.13 (cli) (built: Dec  6 2022 05:53:26) (NTS)
       Copyright (c) The PHP Group
       Zend Engine v4.1.13, Copyright (c) Zend Technologies
           with Zend OPcache v8.1.13, Copyright (c), by Zend Technologies
           with Xdebug v3.2.0, Copyright (c) 2002-2022, by Derick Rethanst
   
       $ wp core version
       6.1.1
   
       $ wp plugin status user-role-editor
       Plugin user-role-editor details:
           Name: User Role Editor
           Status: Network Active
           Version: 4.63.2
           Author: Vladimir Garagulya
           Description: Change/add/delete WordPress user roles and capabilities.
       ```
   
 *  Plugin Author [Vladimir Garagulya](https://wordpress.org/support/users/shinephp/)
 * (@shinephp)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/fatal-errors-w-php-8-1/#post-16427816)
 * Thank you. I added additional type checking to the code. It will be available
   with the next update.
 * Btw., line #81 calls in_array() this way:
 * `in_array('deprecated', $builtin_wp_caps[$cap_id] )`
 * where $builtin_wp_caps is URE’s internal data structure, and the only case when`
   $builtin_wp_caps[$cap_id]` can be an integer instead of array of capabilities
   groups ID is an invalid use of ‘ure_built_in_wp_caps’ filter. Do you or one of
   your plugins use ‘ure_built_in_wp_caps’ filter?
 *  Thread Starter [minutemedia](https://wordpress.org/support/users/minutemedia/)
 * (@minutemedia)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/fatal-errors-w-php-8-1/#post-16430055)
 * Thanks a lot! You are 100% correct, we were using the filter wrong. Appreciate
   your help, and your great work on this plugin!
    -  This reply was modified 3 years, 3 months ago by [minutemedia](https://wordpress.org/support/users/minutemedia/).

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Fatal Errors w/ PHP 8.1’ is closed to new replies.

 * ![](https://ps.w.org/user-role-editor/assets/icon-256x256.jpg?rev=1020390)
 * [User Role Editor](https://wordpress.org/plugins/user-role-editor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-role-editor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-role-editor/)
 * [Active Topics](https://wordpress.org/support/plugin/user-role-editor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-role-editor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-role-editor/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [minutemedia](https://wordpress.org/support/users/minutemedia/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/fatal-errors-w-php-8-1/#post-16430055)
 * Status: resolved