php int 与 integer区别

//integer 是集合 ℤ = {..., -2, -1, 0, 1, 2, ...} 中的某个数。
//int  只是整数
function show($id) : int
{
       return $id;
}
function show($id) : integer
{
       return $id;
}

上述例子中   第一个执行成功 ,但是对于第二个而言   要求返回一个integer实例

链接:https://stackoverflow.com/questions/10636321/php-difference-between-int-and-integer

猜你喜欢

转载自blog.csdn.net/weixin_40076986/article/details/82216861