After updating core from 7.61 to 7.64 this began to occur on Drupal Commerce checkout:
Error: Unsupported operand types in form_builder() (line 1816 of (...)/includes/form.inc).
I checked the form.inc diff:

And noticed that is_array() validation was removed.
Note that if the $element parameter comes NULL it won't throw anything because setting $element['#processed'] = FALSE; will "cast" it as an array. But, if the $element comes as, for example, an integer, then we'll have a problem.
Unfortunately I wasn't able to retrieve much information from log.
Probably the is_array() validation should be kept.
Comments
Comment #2
marcofernandes commentedAdded a patch to revert the validation code removal.
Comment #3
fred1978 commentedI had the same error message when upgrading from PHP 5.6 to PHP 7.2 on Drupal 7.64. The error occured when submitting a custom-made form.
Reverting the changes in form.inc as per patch #2 solved the issue.
Comment #4
ebarrette commentedI don't know why your form.inc was different, are you sure you did not have a custom patch?
This files hasn't changed between the two version.
https://git.drupalcode.org/project/drupal/blob/7.61/includes/form.inc
https://git.drupalcode.org/project/drupal/blob/7.64/includes/form.inc
We are having the same issue only when using PHP 7.2, haven't tested with 7.1. Works fine with PHP 7.0 and 5.6
Comment #5
marqpdx commentedWe're having the same issue. In the process of upgrading to 7.66, and the `is_array()` validation is missing, so will break on php 7.1 and 7.2
See here: https://git.drupalcode.org/project/drupal/blob/7.66/includes/form.inc
How can we get that back in? We're on Pantheon and it's extra work to patch core files w/ them.
Am trying downgrading to php 7.0.
thx,
m
Comment #6
ebarrette commentedThe fix proposed here is a band-aid solution. This is most likely an issue with a contrib/custom module you are using.
When we moved to 7.2 we also started seeing this issue, for us it was this piece of code in a custom implementation of the workbench moderation module.
This line
had to be changed to
Check out these other issues:
https://www.drupal.org/project/workbench_moderation/issues/2871962
https://www.drupal.org/project/entity_pager/issues/2938211