Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Largest Possible Integer Constant

Tags:

php

integer

Was reading the PHP manual on integer overflow in the manual and was wondering: is there a PHP pre-defined constant for the current largest integer value possible? Something equivalent to the JavaScript Number.MAX_VALUE constant.

like image 841
leepowers Avatar asked Nov 30 '10 18:11

leepowers


2 Answers

From here:

PHP_INT_MAX (integer)
    Available since PHP 4.4.0 and PHP 5.0.5 
like image 167
Jon Avatar answered Sep 28 '22 01:09

Jon


PHP_INT_MAX according to PHP.net. Please note that the actual max value depends on whether PHP is compiled for 32bit or 64bit.

Also, you can use PHP_INT_SIZE to get the size of the integer.

like image 37
GolezTrol Avatar answered Sep 28 '22 01:09

GolezTrol