【发布时间】:2015-08-31 20:35:40
【问题描述】:
演示
$code = '40001042901';
echo (int)$code; //intval($code) //same
我在 linux (Ubuntu) 上测试结果是 40001042901,但在 windows 上结果是 2147483647,这有什么问题?
XAMPP 1.8.3、PHP 5.5.15、Apache 2.4.10 (Win32)
【问题讨论】:
-
php.net/manual/en/language.types.integer.php - 阅读有关溢出的信息。
-
因为 `$code = '40001042901' - value 是一个字符串
-
64 位软件与 32 位软件
-
@HoboSapiens,您能详细说明一下吗?
-
@whitelettersandblankspaces 有什么要详细说明的? 32 位系统 => 最大 int 值为 2^31 -1 = 2147483647 == PHP_INT_MAX....
标签: php windows xampp parseint