ID:               47795
 Updated by:       scott...@php.net
 Reported By:      bphelan at paycomonline dot com
-Status:           Open
+Status:           Wont fix
 Bug Type:         Strings related
 Operating System: Windows XP
 PHP Version:      5.3.0RC1
 New Comment:

We are sorry, but we can not support PHP 4 related problems anymore.
Momentum is gathering for PHP 6, and we think supporting PHP 4 will
lead to a waste of resources which we want to put into getting PHP 6
ready.

We only take bug reports against the latest versions, if you want to
look at where something is fixed then look at the changelog.


Previous Comments:
------------------------------------------------------------------------

[2009-03-26 21:16:56] bphelan at paycomonline dot com

Description:
------------
Whenever you compare strings of the format "1D-XXXX" where XXXX is any
number between 4950 and 5201, they will always return true. For example
"1D-5155" == "1D-5200" will return true.

We are running an old version of PHP (4.3.6) but I haven't found any
instance where this bug was encountered. If this error has already been
corrected, if someone could let me know which version it was fixed, I'd
appreciate it.

Reproduce code:
---------------
for($i = 4950; $i <= 5201; $i++){
        $compareInt = "1D-$i";
        
        if($compareInt == "1D-5155"){
                echo "$compareInt == 1D-5155<BR>";
        }
        else{
                echo "$compareInt != 1D-5155<BR>";
        }
}

Expected result:
----------------
I've generated a simple for loop that goes through all of the values in
the range. One would expect that only one instance would be correct,
namely the case where $compareInt is "1D-5155"

Actual result:
--------------
If you take a look at the code you will see the listing of which values
are considered equal and which are not. For some reason all strings
within the range of 4950 to 5201 are considered equal if they are
compared against each other. All other strings outside of the range
appear to be compared as expected.


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=47795&edit=1

Reply via email to