note 81621 added to language.types.null
| From: | rburgholatveeteedotedu at osu1 dot php dot net | Date: | Thu, 06 Mar 2008 16:17:14 +0000 |
| Subject: | note 81621 added to language.types.null | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-136791@lists.php.net to get a copy of this message | ||
With php 5.2.4 on Windows, a variable value of 0 is evaluated as equivalent to the string
'NULL'. So, one must use the strict equivalency test here too (===).
Example:
<?php
$tvar = 0.0;
if ($tvar == 'NULL') {
print("Match");
} else {
print("No Match");
}
if ($tvar === 'NULL') {
print("Match");
} else {
print("No Match");
}
?>
Output:
Match
No Match
----
Server IP: 208.69.120.35
Probable Submitter: 192.234.163.10
----
Manual Page -- http://www.php.net/manual/en/language.types.null.php
Edit -- https://master.php.net/note/edit/81621
Del: integrated -- https://master.php.net/note/delete/81621/integrated
Del: useless -- https://master.php.net/note/delete/81621/useless
Del: bad code -- https://master.php.net/note/delete/81621/bad+code
Del: spam -- https://master.php.net/note/delete/81621/spam
Del: non-english -- https://master.php.net/note/delete/81621/non-english
Del: in docs -- https://master.php.net/note/delete/81621/in+docs
Del: other reasons-- https://master.php.net/note/delete/81621
Reject -- https://master.php.net/note/reject/81621
Search -- https://master.php.net/manage/user-notes.php