Title: Warning: Array was modified by the user comparison function
Last modified: August 20, 2016

---

# Warning: Array was modified by the user comparison function

 *  Resolved [Florence](https://wordpress.org/support/users/floortjahh/)
 * (@floortjahh)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/warning-array-was-modified-by-the-user-comparison-function/)
 * Hi, I’m getting this warning and I don’t know why. It was working just fine a
   couple of weeks ago.
 * `Warning: usort() [function.usort]: Array was modified by the user comparison
   function in cookingblondes.nl/public_html/wp-content/plugins/author-avatars/lib/
   UserList.class.php on line 644`
 * I went to that file but all it says is this on that line. It’s not anything I’ve
   modified:
 * `usort($users, array($this, '_user_cmp_postcount'));`
 * Any ideas? Thanks!
 * [http://wordpress.org/extend/plugins/author-avatars/](http://wordpress.org/extend/plugins/author-avatars/)

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

 *  Plugin Author [Paul Bearne](https://wordpress.org/support/users/pbearne/)
 * (@pbearne)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/warning-array-was-modified-by-the-user-comparison-function/#post-3506464)
 * Hi
 * I am sorry I don’t know what the problem is here
 * usort re-oreders the array this is done with the function _user_cmp_postcount
   which looks at the number of post and returns the diff
 * can you try a different sort and see if that also errors
 * Paul
 *  Thread Starter [Florence](https://wordpress.org/support/users/floortjahh/)
 * (@floortjahh)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/warning-array-was-modified-by-the-user-comparison-function/#post-3506579)
 * Hello Pbearne, thank you for your response. I have been terribly busy lately,
   but now I have time to fix this issue. I’m sorry but don’t know what you mean
   by trying a different sort. I did change the stylesheet a little bit.
 * -Florence
 *  Plugin Author [Paul Bearne](https://wordpress.org/support/users/pbearne/)
 * (@pbearne)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/warning-array-was-modified-by-the-user-comparison-function/#post-3506580)
 * I have found that sometimes usort will return an error on some systems so I have
   changed them in the next version to @usort() which does not return the error
 *  Thread Starter [Florence](https://wordpress.org/support/users/floortjahh/)
 * (@floortjahh)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/warning-array-was-modified-by-the-user-comparison-function/#post-3506581)
 * Sweet, thanks! I will be waiting for that update.
 * Kind regards,
    -Florence

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

The topic ‘Warning: Array was modified by the user comparison function’ is closed
to new replies.

 * ![](https://ps.w.org/author-avatars/assets/icon-256x256.png?rev=973937)
 * [Author Avatars List/Block](https://wordpress.org/plugins/author-avatars/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/author-avatars/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/author-avatars/)
 * [Active Topics](https://wordpress.org/support/plugin/author-avatars/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/author-avatars/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/author-avatars/reviews/)

## Tags

 * [array](https://wordpress.org/support/topic-tag/array/)
 * [list](https://wordpress.org/support/topic-tag/list/)
 * [warning](https://wordpress.org/support/topic-tag/warning/)

 * 4 replies
 * 2 participants
 * Last reply from: [Florence](https://wordpress.org/support/users/floortjahh/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/warning-array-was-modified-by-the-user-comparison-function/#post-3506581)
 * Status: resolved