[PHP-DEV] PHP 4.0 Bug #8279: Abnormal results in integer comparaison From: zas <email protected>
Date: 12/15/00

From: zas <email protected>
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

-- 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>