From:             florian at in dot tum dot de
Operating system: any
PHP version:      Irrelevant
PHP Bug Type:     Documentation problem
Bug description:  Error in loose comparison table (EMPTY STRING and NULL)

Description:
------------
Correction:
-------------
the manual's comparison tables (appendix P) say that the loose comparison
between the EMPTY STRING and NULL evaluates to FALSE, but actually this is
not correct.
And therefore that evaluation does espacially not match the behavior of
is_null()...

is_null("")        //=> FALSE
("" == NULL)    //=> TRUE, not false


(I've tested it quite intensely, on linux as well as on windows, different
PHP versions etc.)

(btw., I've posted this issue as a note on the documentation page, sorry
for that. could any-one delet it, maybe? thanks.) 


Reproduce code:
---------------
print( ("" == null) ? "true <br />" : "false <br />" );
print( (is_null("")) ? "true <br />" : "false <br />" );

Expected result:
----------------
false
false

Actual result:
--------------
true
false

-- 
Edit bug report at http://bugs.php.net/?id=39831&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=39831&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=39831&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=39831&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=39831&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=39831&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=39831&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=39831&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=39831&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=39831&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=39831&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=39831&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=39831&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=39831&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=39831&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=39831&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=39831&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=39831&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=39831&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=39831&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=39831&r=mysqlcfg

Reply via email to