From: killabee at bk dot ru
Operating system: Linux Red Hat, Windows 2000
PHP version: 4.4.4
PHP Bug Type: Scripting Engine problem
Bug description: NULL
Description:
------------
Expresions like (NULL == 0) or (NULL == '') evaluate to TRUE. I doubt
whether it is correct, but unambiguously it is inconvenient. If a variable
$Var = 0 or $Var = '' then empty($Var) returns TRUE, while isset($Var)
returns
TRUE too. From the other side when $Var = NULL isset($Var) returns FALSE.
>From this point empty string with 0 and NULL are not the same. Moreover
manual says
"Also note that a NULL byte ("\0") is not equivalent to the PHP NULL
constant." So why NULL is equal to 0 and '' then?
NULL means that variable has no value in php context or in other words is
unset. So, I guess that check like $Var == NULL must has the same meaning
like !isset($Var).
--
Edit bug report at http://bugs.php.net/?id=38979&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=38979&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=38979&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=38979&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=38979&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=38979&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=38979&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=38979&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=38979&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=38979&r=support
Expected behavior: http://bugs.php.net/fix.php?id=38979&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=38979&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=38979&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=38979&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38979&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=38979&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=38979&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=38979&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=38979&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=38979&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=38979&r=mysqlcfg