When using Drupal, you may get a nasty error like:

“warning: array_key_exists(): The second argument should be either an array or an object in…”

It usually happens when you make DB dump and tar-up files and move all of it to another server/domain.

Quick fix is as follows: you need to log into the database and empty cache by issuing:

delete from cache;

And then you need to access admin/themes page of your website. You may, also, need to go to admin/modules and hit “Save Settings”. All of these help Drupal to re-initialize in the new environment and the problem should go away.