问题
Why does php and js give different results to the same thing: JS:
1085 << 24 = 1023410176
PHP:
1085 << 24 = 18203279360
回答1:
The operands of a bitwise operation in JavaScript are always treated as int32, and in PHP this is not the case.
And in PHP, the bits do not get truncated because it is not treated as a 32-bit integer.
Difference in the results of operations bitwise between javascript and php
来源:https://stackoverflow.com/questions/50518081/bitwise-operations-php-and-js-different