Help! A simple script line giving 2 different results on 2 different hostings !

Discussion in 'PHP' started by picobello, Aug 15, 2007.

  1. #1
    The following script line does not echo the same output on 2 different hotings:

    echo -4738698913^43814;
    PHP:
    The correct result - the one I am expecting is:
    -443704711

    On one hosting it is ok and on the other one it outputs:
    -2147439834

    Any idea?

    Thanks
     
    picobello, Aug 15, 2007 IP
  2. tamilsoft

    tamilsoft Banned

    Messages:
    1,155
    Likes Received:
    78
    Best Answers:
    0
    Trophy Points:
    0
    #2
    It may happened by different PHP versions

    Read this:
    http://bugs.php.net/bug.php?id=32320
     
    tamilsoft, Aug 15, 2007 IP
  3. picobello

    picobello Well-Known Member

    Messages:
    572
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    110
    #3
    Thanks

    I found a solution

    It is linked to PHP5 which introduced a severe bug in the XOR function. Depending on the server, it works or not

    Found a work-around function replacing the XOR

    Thanks again
     
    picobello, Aug 15, 2007 IP