Strange 'if' test bug?
| From: | Steve McGill | Date: | Tue, 31 Aug 2004 08:35:01 +0000 |
| Subject: | Strange 'if' test bug? | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-24469@lists.php.net to get a copy of this message | ||
Sorry if this is a newbie FAQ,
<?php
$key=0;
if($key == "muppet") {
echo "key is a muppet: $key";
} else {
echo "key is something else: $key";
}
?>
Will print completely the wrong line:
====> key is a muppet: 0
If I use three equals signs, i.e. ===, then the test works.
But if I use linux, the test works as expected with two equals signs.
What on earth am I missing?
Using Windows PHP 4.3.8 as a CGI, on Apache 1.3.31.
Many thanks in advance for any help,
Steve