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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-17 11:03 UTC] stas@php.net
Fixed in CVS, thanks.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 02 07:01:33 2025 UTC