Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Win7, 64 bit.


64-bit PHP on Windows does not support 64-bit integers. 'echo PHP_INT_MAX;' would return 2^31 on a 64-bit Windows build.

From http://windows.php.net/: "The x64 builds of PHP for Windows should be considered experimental, and do not yet provide 64-bit integer or large file support." PHP's principle of most surprise in action.


This isn't quite true. PHP has 64-bit releases for Windows, but they are considered experimental, and prior to PHP 7, they only used 32-bit integers. That is because of the Windows/Unix C "long" size issue, which PHP 7 fixes by using a typedef for its integer type which is defined differently on Windows.


I really meant there are no 64-bit integers on PHP on Windows, even if there are 64-bit builds. I wrote that comment on my phone while getting off the bus and just updated it.


Well, I object to the "principle of most surprise". The 64-bit builds are experimental for a reason (you wouldn't expect no 64-bit integers), and this issue really isn't PHP's fault.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: