Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/250.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
PHP int值取决于系统_Php_Int_Bigint - Fatal编程技术网

PHP int值取决于系统

PHP int值取决于系统,php,int,bigint,Php,Int,Bigint,我在不同的机器上使用相同的代码 Ubuntu 64 $test = 51339780210; echo (int) $test; die; //result : 51339780210 Centos 32 $test = 51339780210; echo (int) $test; die; //result : -199827342 为什么这些结果不同?两个系统都有多少位?这可能是32位系统和64位系统之间的差异。在两个系统上执行uname-a。我假设u

我在不同的机器上使用相同的代码

Ubuntu 64

$test = 51339780210;         
echo (int) $test; die; //result : 51339780210
Centos 32

$test = 51339780210;         
echo (int) $test; die; //result : -199827342

为什么这些结果不同?

两个系统都有多少位?这可能是32位系统和64位系统之间的差异。

在两个系统上执行uname-a。我假设ubuntu使用x86_64表示64位,而Centos使用i686表示32位。

来源:


第二个系统是32位的吗?这取决于系统是32位还是64位。
   The size of an integer is platform-dependent ...