echo vs echo intval PHP

echo vs echo intval PHP

问题描述:

请以下某人解释结果差异

Please can some one explain the result differences below

echo intval(1e10); 

输出1410065408

echo 1e10; 

输出10000000000

带符号整数具有最大值.在32位系统上,该值为2 ^ 16或2147483647.intval-输入更大的数字时,它将溢出.您找到的值也可以计算:

A signed integer has a maximum value. On 32-bit systems, that's 2^16 or 2147483647. When intval-ing a number that's larger, it will overflow. The value you found can also calculated:

php > echo 1e10 % (2147483647);
1410065408