note 106983 added to language.operators.comparison

From: Date: Sat, 24 Dec 2011 13:50:12 +0000
Subject: note 106983 added to language.operators.comparison
Groups: php.notes 
Request: Send a blank email to php-notes+get-185230@lists.php.net to get a copy of this message
Be cautious when using === and !== operators and be sure that you understand their meanings. ($a === TRUE) is not the same as ($a !== FALSE). When testing the return value of a function that may return boolean false or a value of another type (like strpos()), do not test for boolean true. The following script will only output "Not false": <?php $a = 5; if ($a === TRUE) { echo "True"; } if ($a !== FALSE) { echo "Not false"; } ?> ---- Server IP: 83.137.20.135 Probable Submitter: 178.85.94.149 ---- Manual Page -- http://www.php.net/manual/en/language.operators.comparison.php Edit -- https://master.php.net/note/edit/106983 Del: integrated -- https://master.php.net/note/delete/106983/integrated Del: useless -- https://master.php.net/note/delete/106983/useless Del: bad code -- https://master.php.net/note/delete/106983/bad+code Del: spam -- https://master.php.net/note/delete/106983/spam Del: non-english -- https://master.php.net/note/delete/106983/non-english Del: in docs -- https://master.php.net/note/delete/106983/in+docs Del: other reasons-- https://master.php.net/note/delete/106983 Reject -- https://master.php.net/note/reject/106983 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#185230) next »