A byte has 8 bits, so the 32-bit int takes 32 bits/8 bits = 4 bytes, and the 64-bit int takes 64 bits/8 bits = 8 bytes.
32-bit, 64-bit unsigned integer maximum value:
2^64-1 = 18446744073709551615
2^32-1 = 4294967295
32-bit, 64-bit signed integer maximum value:
(2^32)/2-1 = 2147483647
(2^64)/2-1 = 9223372036854775807
Minus 1 because the integral type includes 0.
The value of 64-bit Ubuntu 14.04,php_int_max is 9223372036854775807, the same as the maximum value of the signed bigint type in MySQL.
The value of 32-bit Ubuntu 14.04,php_int_max is 2147483647, the same as the maximum value of the signed INT in MySQL.
echo Date (' y-m-d h:i:s ', Php_int_max); return 2038-01-19 11:14:07
echo strtotime (' 2038-01-19 11:14:07 '); Returns 2147483647
echo strtotime (' 2038-01-19 11:14:08 '); Returns null under 32 bits
That is, PHP's time () on a 32-bit system can only return a timestamp of 2038-01-19 11:14:07.
Field type: ' Posted ' int (ten) unsigned not NULL DEFAULT ' 0 '
On 32-bit MySQL (same as 64-bit MySQL), an error occurs when inserting a larger number than the 32-bit unsigned int type maximum 2^32-1 = 4294967295:
UPDATE ' PunBB '. ' pb_topics ' SET ' posted ' = ' 4294967296 ' WHERE ' pb_topics '. ' id ' = 1;
Warning: #1264 out of range value for column ' posted ' at row 1
However, MySQL can store 64-bit integers with a 8-byte bigint type.
This article permanently updates the link address : http://www.linuxidc.com/Linux/2016-02/128479.htm