#39831 [Opn->Csd]: Error in loose comparison table (EMPTY STRING and NULL)

From: Date: Thu, 14 Dec 2006 16:45:30 +0000
Subject: #39831 [Opn->Csd]: Error in loose comparison table (EMPTY STRING and NULL)
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969374587@lists.php.net to get a copy of this message
ID: 39831 Updated by: colder@php.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

« previous php.doc (#969374587) next »