Better to return an empty string or null value
<p>If I were writing the below method (for example) is it considered good practice to either:</p>

<p>A: return an empty string if the document didn't exist</p>

<p>B: return a null value?</p>

<p>Having done a lot of Java, and methods in Java requiring a return type I'm under the impression it is best practice to return a consistent type, is this also the case in PHP or is it better to return a null value instead?</p>

<pre><code>DocumentClass
{
    public function getDir($documentId)
    {
        /* Code to get location of document  */
        return (file_exists($document) ? $document : '');
    }
}

if (!empty($documentClass-&gt;getDir(5))
{
    /* Do this */
}
</code></pre>

<p>If it is better to return a null value, can you explain why?</p>

<p>Thanks!</p>
