Strange comparison behaviour
| From: | Erwin Kerk | Date: | Fri, 13 May 2005 08:18:16 +0000 |
| Subject: | Strange comparison behaviour | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-215123@lists.php.net to get a copy of this message | ||
Hi All,
Can anyone explain me why the following code:
if ("info" == 0) echo "is 0\n"; else echo "not 0\n";
Results in: not 0
Whereas:
if ("inf" == 0) echo "is 0\n"; else echo "not 0\n";
Results in: is 0
Notice the difference: info in the first sample, inf in the second sample.
The used PHP version is PHP 4.1.2 (CLI version)
Erwin Kerk