if statement probable bug
| From: | TheI2eptile | Date: | Thu, 24 Mar 2005 14:05:14 +0000 |
| Subject: | if statement probable bug | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-211463@lists.php.net to get a copy of this message | ||
Probably this is the wrong place to put this but I couldn't search for the bug and what I saw in the bugs newsgroup was a bit strange and seem to be a log for the bugs forms.
So here is what I would call a bug, but maybe it's thought to be so:
<?php
$var1 = 0;
$var2 = "AS";
if($var1 == "AS"){
echo "<br>Why is this printed";
}
if(0 == "AS"){
echo "<br>At least this should not be printed";
}
if($var2 == "AS"){
echo "<br>Only this should";
}
?>
I didn't expect it. I use php 5.02 and have the zend debugger installed. Does anybody see every echo and finds this strange in a typeless language?