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 [Opn->Csd]: Error in loose comparison table (EMPTY STRING and NULL)
by colder other posts by this author
Dec 14 2006 8:46AM messages near this date
[PHP-DOC] #39831 [NEW]: Error in loose comparison table (EMPTY STRING and NULL) | [PHP-DOC] cvs: phpdoc /en/reference/mail/functions mail.xml
ID:               39831
 Updated by:       colder@[...].net
 Reported By:      florian at in dot tum dot de
-Status:           Open
+Status:           Closed
 Bug Type:         Documentation problem
 Operating System: any
 PHP Version:      Irrelevant
-Assigned To:      
+Assigned To:      colder
 New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.




Previous Comments:
------------------------------------------------------------------------

[2006-12-14 11:40:26] florian at in dot tum dot de

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 this bug report at http://bugs.php.net/?id=39831&edit=1
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