Philarmon Posted February 18, 2007 Share Posted February 18, 2007 Hello ! Hopefully someone can help me with this weird problem I got a script that works just fine on my local machine but is going mad on my web server. After a lot of tracing i figured out that this line returns two different values on my machine and on the web server: $a ^= (43814); The result on my local machine is -443704711 and on the web server it is -2147439834 . Now i am not a PHP guru at all and i even don't know what this line is supposed to do, its just pretty strange that the same thing works differnet on different servers Now, as far as i know there are two differences between my local server (its an xampp package) and my webserver: My server: Windows machine PHP 5.1.4 installed Web server: Linux PHP 5.2.0 I hope someone knows about this problem and can suggest a workaround ? Oh, and at least - what is this line about ? Thank you ! Link to comment https://forums.phpfreaks.com/topic/39067-a-weird-problem-with-operator/ Share on other sites More sharing options...
effigy Posted February 18, 2007 Share Posted February 18, 2007 It's a bitwise operator. What's the value of $a on both machines before this line executes? Link to comment https://forums.phpfreaks.com/topic/39067-a-weird-problem-with-operator/#findComment-188189 Share on other sites More sharing options...
utexas_pjm Posted February 18, 2007 Share Posted February 18, 2007 Some bitwise operators will act differently on 32 bit systems (ie x86) and 64 bit systems (ie AMD64). Check the architecture of your production server. Best, Patrick Link to comment https://forums.phpfreaks.com/topic/39067-a-weird-problem-with-operator/#findComment-188238 Share on other sites More sharing options...
Philarmon Posted February 20, 2007 Author Share Posted February 20, 2007 It's a bitwise operator. What's the value of $a on both machines before this line executes? Its -4738698913 on both machines. Thanks for your time Sorry, "Check the architecture of your production server" would not help me a lot because i dont even know what is it all about But thanks fot the suggestion anyways Link to comment https://forums.phpfreaks.com/topic/39067-a-weird-problem-with-operator/#findComment-189115 Share on other sites More sharing options...
sspoke Posted February 20, 2007 Share Posted February 20, 2007 its a overflow problem it overflows the max integer number causing negivate numbers Link to comment https://forums.phpfreaks.com/topic/39067-a-weird-problem-with-operator/#findComment-189146 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.