php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8279 Abnormal results in integer comparaison
Submitted: 2000-12-15 10:55 UTC Modified: 2000-12-17 11:03 UTC
From: zas at norz dot org Assigned:
Status: Closed Package: *General Issues
PHP Version: 4.0.3pl1 OS: linux 2.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: zas at norz dot org
New email:
PHP Version: OS:

 

 [2000-12-15 10:55 UTC] zas at norz dot 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));



?>


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-17 11:03 UTC] stas@php.net
Fixed in CVS, thanks.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 15 19:01:34 2024 UTC