Title: Fatal Error: Cannot use string offset as an array
Last modified: January 5, 2021

---

# Fatal Error: Cannot use string offset as an array

 *  Resolved [jessicamc](https://wordpress.org/support/users/jessicamc/)
 * (@jessicamc)
 * [5 years, 5 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-8/)
 * Hello,
 * This error appears after updating to any version after 2.1.1.
 * Errors are as follows:
    **PHP Fatal error: Uncaught Error: Cannot use string 
   offset as an array in /wp-content/plugins/wp-user-avatar/includes/class-wp-user-
   avatar-functions.php:226**
 * After updating there are errors that occur in two places:
    1. The dashboard of
   the backend, where comments are displayed, instead there are multiple errors 
   and the dashboard stops loading anything after it. 2. Comments that users leave
   on posts on the front end
 * I found that when I comment out the code on lines 226 and 227 of class-wp-user-
   avatar-functions.php, the errors are removed from place 1 above, and the comments
   are loaded on place 2 above. But while the comments are loaded in place 2, the
   avatar of the user appears as if they never chose one (default image).
 * Looking at the changelog for this plugin, I noticed the plugin developer had 
   seen this error elsewhere and resolved it in version 2.2 but for a section a 
   few lines down from where my error is throwing. Not in the same place, but close
   to it (lines 248-252)
    [https://pluginarchive.com/wordpress/wp-user-avatar/v/2-2-2/2-1-9](https://pluginarchive.com/wordpress/wp-user-avatar/v/2-2-2/2-1-9).
 * I thought it could be my theme but I am finding the same errors when switching
   to the twenty twenty theme.
    Error is present in the most recent wordpress core
   update (5.6) as well as 5.3.1 that I had updated from.
 * Thank you!

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

 *  Plugin Author [Collins Agbonghama](https://wordpress.org/support/users/collizo4sky/)
 * (@collizo4sky)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-8/#post-13895994)
 * [@jessicamc](https://wordpress.org/support/users/jessicamc/) can you please add
   the code below before Line 226?
 * `$wpua_hash_gravatar = [];`
 * Let me know if that fixes the issue.
 *  Plugin Author [Collins Agbonghama](https://wordpress.org/support/users/collizo4sky/)
 * (@collizo4sky)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-8/#post-13915064)
 * Fixed in the latest version. Is it still happening?
 *  Thread Starter [jessicamc](https://wordpress.org/support/users/jessicamc/)
 * (@jessicamc)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-8/#post-13959233)
 * Hi Collins,
 * Yes, this has been resolved! Thank you for your time.

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

The topic ‘Fatal Error: Cannot use string offset as an array’ is closed to new replies.

 * ![](https://ps.w.org/wp-user-avatar/assets/icon-256x256.png?rev=2532486)
 * [Paid Membership Plugin, Ecommerce, User Registration Form, Login Form, User Profile & Restrict Content – ProfilePress](https://wordpress.org/plugins/wp-user-avatar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-user-avatar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-user-avatar/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-user-avatar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-user-avatar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-user-avatar/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [jessicamc](https://wordpress.org/support/users/jessicamc/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/fatal-error-cannot-use-string-offset-as-an-array-8/#post-13959233)
 * Status: resolved