Checking if your code is running on 64-bit PHP

Check the PHP_INT_SIZE constant. It’ll vary based on the size of the register (i.e. 32-bit vs 64-bit).

In 32-bit systems PHP_INT_SIZE should be 4, for 64-bit it should be 8.

See http://php.net/manual/language.types.integer.php for more details.

Leave a Comment