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

Popular posts from this blog

google chrome - Developer tools - How to inspect the elements which are added momentarily (by JQuery)? -

angularjs - Showing an empty as first option in select tag -

php - Cloud9 cloud IDE and CakePHP -