PHP 4.0 Bug #6818: Variable evaluating as 0 always matches against string
| From: | daniel at elektron dot se | Date: | Wed, 20 Sep 2000 22:57:53 +0000 |
| Subject: | PHP 4.0 Bug #6818: Variable evaluating as 0 always matches against string | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-33515@lists.php.net to get a copy of this message | ||
From: daniel@elektron.se
Operating system: Linux/Redhat6
PHP version: 4.0.2
PHP Bug Type: Variables related
Bug description: Variable evaluating as 0 always matches against string
This piece of code describes my problem:
<?
$variable = 0;
if ($variable == "some_string")
{
print "This must be a bug?! Variable set as $variable.\n\n<br>";
$variable++;
if ($variable != "some_string")
{
print "But with variable set as $variable it works fine.\n\n";
}
}
else
{
print "This works as I expected.\n\n";
}
?>