Edit report at https://bugs.php.net/bug.php?id=62228&edit=1

 ID:                 62228
 Updated by:         larue...@php.net
 Reported by:        starway49 at hotmail dot com
 Summary:            equal operator does not correct
 Status:             Not a bug
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   ALL
 PHP Version:        5.3.13
 Block user comment: N
 Private report:     N

 New Comment:

s#convert to integer#convert to number#g


Previous Comments:
------------------------------------------------------------------------
[2012-06-05 05:32:18] larue...@php.net

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

0x00 -> hex 0
0e04 -> science nonation 0 * 10^4 

they all are numeric string. php will convert them to integer before comparing.

------------------------------------------------------------------------
[2012-06-05 02:51:59] starway49 at hotmail dot com

Description:
------------
this problom may happen in PHP5.2~5.4

<?php
    echo '0X00' == '0E04';  //return 1

    if ('0X00' == '0E04') {
        echo '0X00 = 0E04'; //the answer is true?!
    }
?>

Test script:
---------------
<?php
    echo '0X00' == '0E04';  //return 1

    if ('0X00' == '0E04') {
        echo '0X00 = 0E04'; //the answer is true
    }
?>

Expected result:
----------------
if ('0X00' == '0E04')
this should return false.



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



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

Reply via email to