Issue #2340701 by prics, martin107: Use array_diff_key() more in core.