Title: Error &#8220;Warning: in_array() expects parameter 2 to be array, null given in&#8221;
Last modified: September 9, 2017

---

# Error “Warning: in_array() expects parameter 2 to be array, null given in”

 *  [breathelifein](https://wordpress.org/support/users/biellebrunner/)
 * (@biellebrunner)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in-2/)
 * I’m getting this message above the favorite button, as well as above the list
   on my sidebar displaying all my favorite posts (the message appears for each 
   favorited post, so it can be multiple – dozens – of times, depending on the user):
 * > Warning: in_array() expects parameter 2 to be array, null given in /home/…/
   > public_html/wp-content/plugins/favorites/app/Entities/User/UserRepository.php
   > on line 188
 * The button works just fine, but these messages won’t go away.
    What’s the matter
   and how to fix this? Thank you.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ferror-warning-in_array-expects-parameter-2-to-be-array-null-given-in-2%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  [ca2450](https://wordpress.org/support/users/ca2450/)
 * (@ca2450)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in-2/#post-9583099)
 * I’m getting same message all of a sudden. What’s the fix? Creator gone silent!
 *  [ericgolftourney](https://wordpress.org/support/users/ericgolftourneygmailcom/)
 * (@ericgolftourneygmailcom)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in-2/#post-9652820)
 * Any update on this? Is there a workaround?
 *  [vinchoz](https://wordpress.org/support/users/vinchoz/)
 * (@vinchoz)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in-2/#post-9658192)
 * Hello,
 * Same problem on my website …
    Is there a solution?
 * Thank’s
 *  Thread Starter [breathelifein](https://wordpress.org/support/users/biellebrunner/)
 * (@biellebrunner)
 * [8 years, 5 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in-2/#post-9750587)
 * Really? No one? =/
 *  [bubba](https://wordpress.org/support/users/koberlin/)
 * (@koberlin)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in-2/#post-9961083)
 * No response from developer, but thanks to Aristeides Stathopoulos in GitHub, 
   replacing define(‘WP_DEBUG’, false); in WP-config file does the trick…
 * ini_set(‘display_errors’,’Off’);
    ini_set(‘error_reporting’, E_ALL ); define(‘
   WP_DEBUG’, false); define(‘WP_DEBUG_DISPLAY’, false);

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

The topic ‘Error “Warning: in_array() expects parameter 2 to be array, null given
in”’ is closed to new replies.

 * ![](https://ps.w.org/favorites/assets/icon-128x128.png?rev=1677726)
 * [Favorites](https://wordpress.org/plugins/favorites/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/favorites/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/favorites/)
 * [Active Topics](https://wordpress.org/support/plugin/favorites/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/favorites/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/favorites/reviews/)

## Tags

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

 * 5 replies
 * 5 participants
 * Last reply from: [bubba](https://wordpress.org/support/users/koberlin/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/error-warning-in_array-expects-parameter-2-to-be-array-null-given-in-2/#post-9961083)
 * Status: not resolved