<?php $large_number = 2147483647; var_dump($large_number); // int(2147483647) $large_number = 2147483648; var_dump($large_number); // float(2147483648) $million = 1000000; $large_number = 50000 * $million; var_dump($large_number); // float(50000000000) ?>
<?php $large_number = 9223372036854775807; var_dump($large_number); // int(9223372036854775807) $large_number = 9223372036854775808; var_dump($large_number); // float(9.2233720368548E+18) $million = 1000000; $large_number = 50000000000000 * $million; var_dump($large_number); // float(5.0E+19) ?>
注:如果系统是64位,但是php是32位的,最终整型会是32位系统下的处理方式