Weird behaviour in PHP and Apache2: different output in different servers
问题 I'm experiencing different outputs in PHP code running in Mac and Linux. I have 2 servers running the following code: $ltt = ((ord($str[7]) << 24) | (ord($str[8]) << 16) | (ord($str[9]) << 8) | (ord($str[10]))) / 1000000; Even the ord(str[ ]) outputs are the same: [7] = 254 [8] = 26 [9] = 22 [10] = 216 But, on the MAMP stack (Mac) running php 5.3.6, if $ltt is originally supposed to be a negative number, it returns 4263.12265 (incorrect). On the LAMP stack (Ubuntu) running same php version,