note 81621 deleted from language.types.null by danbrown
| From: | danbrown@php.net | Date: | Tue, 19 May 2009 14:18:27 +0000 |
| Subject: | note 81621 deleted from language.types.null by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-155734@lists.php.net to get a copy of this message | ||
Note Submitter: rburghol a t veetee dot edu
----
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