Should I always check args for a function in PHP?
<p>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. </p>

<p>A lot of my code ends up looking like this:</p>

<pre><code>public function($arg1 = 'default', $arg2 = false)
{
   if(!empty($arg2) &amp;&amp; $arg1 != 'default) {
     // do something here
    }
}
</code></pre>

<p>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.</p>

<p>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.</p>

<p>For instance, after running an SQL query and fetching the results I ALWAYS do
 <code>if(!empty($results)) //go do stuff</code></p>

<p>Should I do this? Am I being paranoid?</p>
