In PHP,How to wrap my own is_empty function?
<p>I tried to wrap my own function using <code>empty()</code>.
The funciton named <code>is_empty</code> is to check whether a value is empty, if it's empty, return a specified value. Code is as below.</p>

<pre><code>static public function is_empty($val,$IfEmptyThenReturnValue)
    {
        if(empty($val))
        {
            return $IfEmptyThenReturnValue;
        }
        else
        {
            return $val;
        }
    } 
</code></pre>

<p>And I call this function like this:</p>

<pre><code>$d="it's a value";
echo  Common::is_empty($d, "null");
</code></pre>

<p>That's ok. It printed the "it's a value".</p>

<p>but if I don't difined the <code>$d</code>. like below:</p>

<pre><code>echo  Common::is_empty($d, "null");
</code></pre>

<p>Yes, it will print the "null".
But it will also print a <code>waring:Notice</code>:</p>

<pre><code> Undefined variable: d in D:\phpwwwroot\test1.php on line 25.
</code></pre>

<p>So how to fix this function?</p>
