Title: PHP Warning: array_key_exists() expects parameter 2 to be array
Last modified: August 25, 2022

---

# PHP Warning: array_key_exists() expects parameter 2 to be array

 *  Resolved [Eder Ribeiro](https://wordpress.org/support/users/ribeiroeder/)
 * (@ribeiroeder)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/php-warning-array_key_exists-expects-parameter-2-to-be-array-2/)
 * I found this error repeated hundreds of times in my error_log.
 * [24-Aug-2022 14:04:37 UTC] PHP Warning: array_key_exists() expects parameter 
   2 to be array, bool given in /home/XXX/public_html/wp-content/plugins/presto-
   player/inc/Integrations/LearnDash/LearnDash.php on line 184
 * [24-Aug-2022 14:04:37 UTC] PHP Warning: array_key_exists() expects parameter 
   2 to be array, bool given in /home/XXX/public_html/wp-content/plugins/presto-
   player/inc/Integrations/LearnDash/LearnDash.php on line 185
 * ———–
 * How to reproduce:
 * Just clone the database from the old site and rename the domain to a new site.
   
   Ex: Rename olddomain.com to newdomain.com
 * Your error_log will always trigger this error on newdomain.com
 * ———–
 * This is a procedure that I do frequently because I have an official site/domain
   and another clone site/domain just for testing.
 * thanks

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

 *  [paulam11](https://wordpress.org/support/users/paulam11/)
 * (@paulam11)
 * [3 years, 9 months ago](https://wordpress.org/support/topic/php-warning-array_key_exists-expects-parameter-2-to-be-array-2/#post-15955663)
 * Hello Eder,
 * Based on what you described, I suspect there may have been an issue during the
   migration.
 * It looks like the code it is trying to retrieve an option from the wp_options
   table, but it’s being passed as a boolean instead of an array.
 * Firstly, try temporarily switching to another theme, like default themes like–
   Twenty-Twenty or Twenty-Nineteen, and check if the error or issue persists.
 * Next, you can deactivate all the plugins temporarily and see if that solves the
   error. If it does, activate plugins one by one to see which plugin is causing
   the problem.
 *  Thread Starter [Eder Ribeiro](https://wordpress.org/support/users/ribeiroeder/)
 * (@ribeiroeder)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-warning-array_key_exists-expects-parameter-2-to-be-array-2/#post-16155005)
 * Hello [@paulam11](https://wordpress.org/support/users/paulam11/)
 * I had already done all these tests but the error persisted.
 * So that I could solve it, it was necessary to edit lines 184/185 to confirm that
   it is an array:
 *     ```
       if (is_array($saved)) {
           $key = array_key_exists('sfwd-lessons_lesson_video_url', $saved) ? 'sfwd-lessons_lesson_video_url' : '';
           $key = array_key_exists('sfwd-topic_lesson_video_url', $saved) ? 'sfwd-topic_lesson_video_url' : $key;
       }
       ```
   
 * Could you pass on to the team responsible for programming? This check does not
   modify the function, it just guarantees to pass a valid array before array_key_exists.
 * thanks.
 *  Plugin Author [Andre Gagnon](https://wordpress.org/support/users/2winfactor/)
 * (@2winfactor)
 * [3 years, 6 months ago](https://wordpress.org/support/topic/php-warning-array_key_exists-expects-parameter-2-to-be-array-2/#post-16173816)
 * Thanks! We’ll get this fixed.

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

The topic ‘PHP Warning: array_key_exists() expects parameter 2 to be array’ is closed
to new replies.

 * ![](https://ps.w.org/presto-player/assets/icon-256x256.png?rev=2831276)
 * [The Ultimate Video Player For WordPress - by Presto Player](https://wordpress.org/plugins/presto-player/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/presto-player/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/presto-player/)
 * [Active Topics](https://wordpress.org/support/plugin/presto-player/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/presto-player/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/presto-player/reviews/)

 * 4 replies
 * 3 participants
 * Last reply from: [Andre Gagnon](https://wordpress.org/support/users/2winfactor/)
 * Last activity: [3 years, 6 months ago](https://wordpress.org/support/topic/php-warning-array_key_exists-expects-parameter-2-to-be-array-2/#post-16173816)
 * Status: resolved