After 4.7 Upgrade Contact Pages Throwing Error
I got this error in Drupal after upgrading 4.6.9 to 4.7.3. Exact text (repeating several times): 

Warning: array_keys() expects parameter 1 to be array, null given in CRM_Utils_Array::formatArrayKeys() (line 1037 of /home/mysitename/public_html/sites/all/modules/civicrm/CRM/Utils/Array.php)


I was able to fix one record by editing &amp; saving. But doing that for thousands of records wasn't an option. 

So comparing custom fields of fixed records to broken records in phpMyAdmin, I found that the fixed records had blank entries whereas broken records were NULL, and that the number of fields that were checkboxes matched the number of error messages. I disabled my custom field sets and the errors went away.

After disabling my fields, I updated the custom field to set the value to blank where value is null. The SQL was similar to this: 

update `civicrm_value_custom_table_1` set `custom_field_123`="" where `custom_field_123` IS NULL;


I repeated that for all problematic fields, enabled my custom fields and all was well.

tl;dr: Cause is NULL values in custom checkbox fields. Fix is to update NULL values to blank values