PHP - Checking for return false;
<p>Just a quick question - and I'm sure really basic!</p>

<p>I have the following code:</p>

<pre><code>function checkThings($foo, $bar) {
    ...
    if ($valid) {
        return $results;
    } else {
        return false;
    }
}
</code></pre>

<p>On the other end of this I am currently doing</p>

<pre><code>$check = checkThings($foo, $bar);
if ($check === false) {
    echo "Error";
} else {
    echo $check;
}
</code></pre>

<p>Is writing the following the same?</p>

<pre><code>$check = checkThings($foo, $bar);
if (!$check) {
    echo "Error";
} else {
    echo $check;
}
</code></pre>

<p>Which method is the preferred method if both are correct?</p>

<p>Thanks :)</p>
