Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to maximize PHP_INT_MAX?

Tags:

php

project

I can't find this row in php.ini, so is there any way to increase PHP_INT_MAX?

like image 213
good_evening Avatar asked May 20 '10 12:05

good_evening


1 Answers

You can increase PHP_INT_MAX. As others have said, PHP_INT_MAX is platform dependent. That means on 32 bit hardware or a 32 bit OS or a 32 bit compile of PHP, PHP stores the bit in 4 bytes (max of about 2 billion). However, if all 3 are 64 bit, the max goes to 8 bytes (about 9e18 or 9,000,000,000,000,000,000).

So if you really want large ints, get a 64bit machine, and a 64bit OS, and a 64bit compile of PHP...

like image 72
ircmaxell Avatar answered Sep 25 '22 01:09

ircmaxell