PHP function doesn't return null but doesn't return anything either
<p>Here is my code, which uses an extended phpMailer.  This works if I check for firstResult and lastResult, but not if I check for emailResult:</p>

<pre><code>$validator = new FormValidator();
            $firstResult = $validator-&gt;checkFirst($_POST['firstname']);
            $lastResult = $validator-&gt;checkLast($_POST['lastname']);
            $emailResult = $validator-&gt;checkEmail($_POST['emailaddress1']);
            var_dump($emailResult);
            if (is_null($firstResult) &amp;&amp; is_null($lastResult) &amp;&amp; is_null($emailResult)) {

                $mail = new ULSMail();

                $mail-&gt;IsSMTP();  // telling the class to use SMTP
                $mail-&gt;AddAddress("shummel@ulsinc.com");

                $mail-&gt;Subject  = "test";
                $mail-&gt;MsgHTML($messageHTML);

                redirectULS('english/forms/thankyou.php');

                if(!$mail-&gt;Send()) {
                    echo 'Message was not sent.';
                    echo 'Mailer error: ' . $mail-&gt;ErrorInfo;
                } else {

                    //$bridge-&gt;pushLead($lead);
                }
            } else {
                //...
            }
</code></pre>

<p>and in my FormValidator class:</p>

<pre><code>function checkEmail($email){

        if(strlen(trim($email)) &lt; 8){
        return 'Please enter a valid email address of more than 8 characters&lt;/span&gt;';
    } else {
        return NULL;
    }

}
</code></pre>

<p>redirectULS is a simple redirect function for internal redirects on my site.  It works as long as I don't check for $emailResult.</p>
