PHP, Bitwise operation, not negative -
when trying code in php:
$result = 4 << 29; var_dump($result); // int(2147483648)
but in other languages, example in java or javascript -2147483648
. why?
this depends on php version you're running. while ago there bug in 32-bit int math when comes overflows. has been solved in php 5.3.
Comments
Post a Comment