Title: array_key_exists() expects parameter 2 to be array, string given
Last modified: May 14, 2018

---

# array_key_exists() expects parameter 2 to be array, string given

 *  Resolved [jordanwebdev](https://wordpress.org/support/users/jordanwebdev/)
 * (@jordanwebdev)
 * [8 years ago](https://wordpress.org/support/topic/array_key_exists-expects-parameter-2-to-be-array-string-given/)
 * I just tried connecting my constant contact account with the plugin and got (
   I omitted sections of the file paths)
 * Warning: array_key_exists() expects parameter 2 to be array, string given in ……../
   plugins/constant-contact-forms/includes/class-settings.php on line 850
 * Warning: Cannot modify header information – headers already sent by (output started
   at …………/plugins/constant-contact-forms/includes/class-settings.php:850) in /home/
   dolcedev/ym-inc.dolcedev.com/wp-includes/pluggable.php on line 1216
 * I think my account linked successfully, but it’s weird how this error occured

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

 *  Plugin Author [Constant Contact](https://wordpress.org/support/users/constantcontact/)
 * (@constantcontact)
 * [8 years ago](https://wordpress.org/support/topic/array_key_exists-expects-parameter-2-to-be-array-string-given/#post-10279983)
 * Interesting.
 * The error line in question is the fallback spot right before we try to return
   whatever is found for fetching of options. Specifically it’s in the fallback 
   area, meaning for some reason, CMB2 wasn’t available at the time to retrieve 
   the setting like we’d prefer.
 * If you have a stack trace of calls for this, we’d love to see it to help narrow
   down the originating spot. However, not the end of the world if you do not. Appears
   that things didn’t have a setting saved and available yet.
 * Is this presenting a persistent issue with the headers already sent warning? 
   or was it a one time thing that has since gone away?
 *  Thread Starter [jordanwebdev](https://wordpress.org/support/users/jordanwebdev/)
 * (@jordanwebdev)
 * [8 years ago](https://wordpress.org/support/topic/array_key_exists-expects-parameter-2-to-be-array-string-given/#post-10284452)
 * It was just a one time thing.
 * Forgive my ignorance, but how would I go about getting a stack trace?
 *  Plugin Author [Constant Contact](https://wordpress.org/support/users/constantcontact/)
 * (@constantcontact)
 * [8 years ago](https://wordpress.org/support/topic/array_key_exists-expects-parameter-2-to-be-array-string-given/#post-10284586)
 * Easiest way I can think of would be utilizing a plugin like [http://wordpress.org/plugins/query-monitor/](http://wordpress.org/plugins/query-monitor/)
   as it does provide some solid debugging information. However, with it being a
   one time thing, we may be past the point of no return for this instance. Regardless,
   we have done some changes to the plugin, for a future version, which will help
   prevent this error from occurring.
 *  Plugin Author [Constant Contact](https://wordpress.org/support/users/constantcontact/)
 * (@constantcontact)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/array_key_exists-expects-parameter-2-to-be-array-string-given/#post-10397670)
 * This spot will be hardened and better prevented at the point of code running,
   in the next major release.
 * Marking resolved

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

The topic ‘array_key_exists() expects parameter 2 to be array, string given’ is 
closed to new replies.

 * ![](https://ps.w.org/constant-contact-forms/assets/icon-256x256.png?rev=2951825)
 * [Constant Contact Forms](https://wordpress.org/plugins/constant-contact-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/constant-contact-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/constant-contact-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/constant-contact-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/constant-contact-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/constant-contact-forms/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Constant Contact](https://wordpress.org/support/users/constantcontact/)
 * Last activity: [7 years, 11 months ago](https://wordpress.org/support/topic/array_key_exists-expects-parameter-2-to-be-array-string-given/#post-10397670)
 * Status: resolved