PHP中int的最大值是多少? [英] What's the maximum value for an int in PHP?

查看:230
本文介绍了PHP中int的最大值是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

忽略允许你使用非常大的数字的特殊库,你可以在PHP中存储的最大int值是什么?

Ignoring the special libraries that allow you to work with very big numbers, what's the largest int value you can store in PHP?

推荐答案

来自 PHP手册


整数的大小是
平台相关的,尽管最大
值约为20亿是
的常规值(这是32位签名)。
PHP不支持unsigned
整数。整数大小可以是
使用常量
PHP_INT_SIZE确定,最大值使用
自定义PHP_INT_MAX,因为PHP
4.4.0和PHP 5.0.5。

The size of an integer is platform-dependent, although a maximum value of about two billion is the usual value (that's 32 bits signed). PHP does not support unsigned integers. Integer size can be determined using the constant PHP_INT_SIZE, and maximum value using the constant PHP_INT_MAX since PHP 4.4.0 and PHP 5.0.5.

64位平台的最大值通常约为9E18,除了在PHP之前的Windows上,它总是32位。

64-bit platforms usually have a maximum value of about 9E18, except on Windows prior to PHP 7, where it was always 32 bit.

这篇关于PHP中int的最大值是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆