Q:

Should I always check args for a function in PHP?

Background disclosure:
I've been working on PHP project for some time now, but only recently started seriously looking up best practices, oop design patterns, new php version features and so on. 
A lot of my code ends up looking like this:
public function($arg1 = 'default', $arg2 = false)
{
   if(!empty($arg2) && $arg1 != 'default) {
     // do something here
    }
}

Almost all of the proper OOP code I've seen in github and whatnot never checks for the presence or correct type of the arguments used.
My question is: Is it considered to be a good practice to ALWAYS have redundant checks on arguments or only in particular situations when Something Bad (tm) might happen.
For instance, after running an SQL query and fetching the results I ALWAYS do
 if(!empty($results)) //go do stuff
Should I do this? Am I being paranoid?

A:

It's good practice to define upfront what the function is supposed to do and to do proper exception handling.
Example - if I'm writing an application, which makes use of a library of mine, then either the application should do some checking or the library should.
I generally choose to do proper checking in the application, so I can notify the user properly. This also takes away the burden of doing it in the library and making it more flexible for use.
But if you choose to do it this way, you should make sure to write all your libraries and applications in a similar way (hence "standard") otherwise it becomes confusing.
I think most things on github will be in the library approach and therefore expect you to do some stuff in the app.

