PHP 4.0 Bug #9478: Two different types compare problem!
| From: | cryp at inet dot lv | Date: | Tue, 27 Feb 2001 13:59:02 +0000 |
| Subject: | PHP 4.0 Bug #9478: Two different types compare problem! | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-47618@lists.php.net to get a copy of this message | ||
From: cryp@inet.lv
Operating system: Linux
PHP version: 4.0.4pl1
PHP Bug Type: Math related
Bug description: Two different types compare problem!
### CODE ###
$Flag = 0;
if ( $Flag == 'N' ) echo "1";
else echo "2";
### END ###
Result: 1
If the $Flag is integer value and 'N' non integer, why this operation gives true as the
result?
This is different types 0 and 'N', but if the programm can compare this values, it will be
better to give "false"!
Can you explane this ?
--
Edit Bug report at: http://bugs.php.net/?id=9478&edit=1