ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> phpdoc
phpdoc
[PHP-DOC] #39831 [NEW]: Error in loose comparison table (EMPTY STRING and NULL)
by Florian At In Dot Tum Dot De other posts by this author
Dec 14 2006 3:41AM messages near this date
[PHP-DOC] cvs: phpdoc /en/appendices comparisons.xml | [PHP-DOC] #39831 [Opn->Csd]: Error in loose comparison table (EMPTY STRING and NULL)
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
Thread:
Florian At In Dot Tum Dot De
colder

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved