array_diff throws notice errors when it finds an array inside an array. See the comment by Michiel Thalen
I may assume that you're running php 5.4 or higher. You can see it by yourself, by checking your array_diff statement in the sandbox (you can switch php versions there)
There's also a discussion in Drupal forums
As a quickfix I suggest this:
$query = @array_diff($params, array('f' => array()));
And in case you're going to use array_diff function with deep arrays, there are plenty of solutions on the net, including official php.net resource.