echo vs echo intval PHP [英] echo vs echo intval PHP

查看:65
本文介绍了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

这篇关于echo vs echo intval PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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