[PHP-DEV] PHP 4.0 Bug #6818: Variable evaluating as 0 always matches against string From: daniel <email protected>
Date: 09/20/00

From: daniel <email protected>
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";
}

?>

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>