PHP 4.0 Bug #8279: Abnormal results in integer comparaison
| From: | zas at norz dot org | Date: | Fri, 15 Dec 2000 15:55:43 +0000 |
| Subject: | PHP 4.0 Bug #8279: Abnormal results in integer comparaison | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-41496@lists.php.net to get a copy of this message | ||
From: zas@norz.org
Operating system: linux 2.2
PHP version: 4.0.3pl1
PHP Bug Type: *General Issues
Bug description: Abnormal results in integer comparaison
<?php
//BUG(??) in php4.03pl1 on integers comparaison
$a =-2147483647;
$min=-2147483648; //min. integer
$max= 2147483647; //max. integer
if ($a>$min) echo "$a > $min <BR>";
echo "<BR>";
echo "---errors---<BR>";
//the 2 following tests return strange results !!!
if ($a<$max) echo "$a < $max <BR>"; else echo "$a > $max
<BR>";
if ($max>$a) echo "$max > $a <BR>"; else echo "$max < $a
<BR>";
echo "<BR>";
echo "---errors---<BR>";
if ($a<0) echo "$a < 0 <BR>"; else echo "$a > 0 <BR>";
if (0>$a) echo "0 > $a <BR>"; else echo "0 < $a <BR>";
echo "<BR>";
highlight_file(basename($PHP_SELF));
?>
--
Edit Bug report at: http://bugs.php.net/?id=8279&edit=1