Bug #9118: 3.0.18 bug - if ("INF" == "INF") {} does not equal true
| From: | bcross at manlab dot com | Date: | Mon, 05 Feb 2001 18:31:01 +0000 |
| Subject: | Bug #9118: 3.0.18 bug - if ("INF" == "INF") {} does not equal true | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-45797@lists.php.net to get a copy of this message | ||
From: bcross@manlab.com
Operating system: Debian Linux
PHP version: 3.0.17
PHP Bug Type: Misbehaving function
Bug description: 3.0.18 bug - if ("INF" == "INF") {} does not equal true
I encountered a strange behaviour of comparing values. I've only encountered it with a value
of "INF". The following script should cause "INF" to be displayed in version
3.0.18 on Linux
<?php
$arr =array(
"TEST",
"INF"
);
$cnt = sizeof($arr);
for ($x=0; $x < $cnt; $x++) {
$item = $arr[$x];
if ("$item" == "$item") {
} else {
print "$item<br>\n";
}
}
?>