title: Correct way to use !is_null()
body: <p>There is an example in PHP Object-Oriented Solutions that seems to be flawed, if I understand is_null properly.</p>
  
  <p>The sample code in the book is as follows:</p>
  
  <pre><code>if (!is_null($required) &amp;&amp; !is_array($required)) {
  throw new Exception('The names of required fields must be an array, even if only one field is required.');
  }
  </code></pre>
  
  <p>This code is supposed to test that a var $required is not NULL and is an array.  To my understanding, is_null() returns TRUE if the variable is not set or is NULL.  So, does it make sense to negate is_null() in that example if you're trying to throw an exception when the variable is not set, NULL, or is not an array?  The only way an exception is thrown is if (true &amp;&amp; true) is satisfied.</p>