Re: distinguish between null variable and unset variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel Brown wrote:
> On Thu, Jan 22, 2009 at 15:11, Shawn McKenzie <nospam@xxxxxxxxxxxxx> wrote:
>> Or something like this (dunno, just brainstorming):
>>
>> function setornull(&$var)
>> {
>>        if (!isset($var)) {
>>                return false;
>>        }
>>        elseif (is_null($var)) {
>>                return null;
>>        }
>>        return true;
>> }
> 
>     Unfortunately, neither solution would work.  isset() will return
> FALSE even for an instantiated and explicitly-defined NULL variable.
> 

Yes, damn it!

-- 
Thanks!
-Shawn
http://www.spidean.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux