PHP 4.0 Bug #8279 Updated: Abnormal results in integer comparaison
| From: | stas@php.net | Date: | Sun, 17 Dec 2000 16:03:17 +0000 |
| Subject: | PHP 4.0 Bug #8279 Updated: Abnormal results in integer comparaison | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-41654@lists.php.net to get a copy of this message | ||
ID: 8279
Updated by: stas
Reported By: zas@norz.org
Old-Status: Open
Status: Closed
Bug Type: *General Issues
Assigned To:
Comments:
Fixed in CVS, thanks.
Previous Comments:
---------------------------------------------------------------------------
[2000-12-15 10:55:43] zas@norz.org
<?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));
?>
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8279