Title: Breaks with PHP 8
Last modified: August 22, 2022

---

# Breaks with PHP 8

 *  [ollycross](https://wordpress.org/support/users/ollycross/)
 * (@ollycross)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/breaks-with-php-8/)
 * This plugin sometimes saves a `null` record to `ip_range` in the `wp_uam_accessgroups`
   table. This is later passed to the `explode` function in `UserGroup.php`. Passing`
   null` to `explode` is a fatal error in PHP 8 and it renders the site unusable
   until the record in the DB is corrected.
 * `Uncaught TypeError: explode(): Argument #2 ($string) must be of type string,
   null given in /var/www/public/wp-content/plugins/user-access-manager/src/UserGroup/
   UserGroup.php:99`
 * This can be corrected by changing line `UserGroup.php:134` to `$this->ipRange
   = $dbUserGroup->ip_range ?? '';`. This ensures that when the `UserGroup` is loaded
   from the database the `ip_range` will fallback to a string if the stored value
   is `null`.

Viewing 1 replies (of 1 total)

 *  [krisknap](https://wordpress.org/support/users/krisknap/)
 * (@krisknap)
 * [3 years, 4 months ago](https://wordpress.org/support/topic/breaks-with-php-8/#post-16446754)
 * Thanks for providing this workaround [@ollycross](https://wordpress.org/support/users/ollycross/)!!
   The upgrade finally working!

Viewing 1 replies (of 1 total)

The topic ‘Breaks with PHP 8’ is closed to new replies.

 * ![](https://ps.w.org/user-access-manager/assets/icon.svg?rev=1563783)
 * [User Access Manager](https://wordpress.org/plugins/user-access-manager/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-access-manager/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-access-manager/)
 * [Active Topics](https://wordpress.org/support/plugin/user-access-manager/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-access-manager/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-access-manager/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [krisknap](https://wordpress.org/support/users/krisknap/)
 * Last activity: [3 years, 4 months ago](https://wordpress.org/support/topic/breaks-with-php-8/#post-16446754)
 * Status: not resolved