Jack Smit
Jack Smit

Reputation: 3113

PHP Bit shift on Windows7

I have a laptop running Windows7 and if I right-click on "Computer" on the desktop and select properties I can see that "System type" is "64-bit Operating system" If I run PHP_INT_MAX as a watch in PHPStorm it gives me 2147483647, why? Does this indicate that PHPStorm is running as 32 bit or is PHP running in 32 bit mode? If I do php --version I can see that I am running PHP 5.4.7

My actual problem is that I am trying to do $result = $var << 5 and $var was 318 497 757 before I got to this line of code. The $result after this line is 1601993632 but should be 10191928224 (if my math is correct)

What is going wrong and where? I have no idea what is wrong or where? Thanks.

Upvotes: 2

Views: 154

Answers (1)

LazyOne
LazyOne

Reputation: 165228

By default, all public PHP builds from windows.php.net website are 32 bit. From your description it sounds like you do have 32-bit one.

If you want 64-bit PHP then you need to find (or compile it yourself) and use 64-bit PHP build.


How to check what xx-bit PHP you are using

Check output of phpinfo() function (or just php -i from command line). Look for Architecture row on the top. 64-bit will have x64 while 32-bit will have x86.

Upvotes: 3

Related Questions