时间:2021-07-01 10:21:17 帮助过:69人阅读
$s = 0xFFFFFFBF;echo $s; //4294967231$s = 'FFFFFFBF';echo hexdec($s);//4294967231
$n = 0xFFFFFFBF;$s = pack('L', $n);echo bin2hex($s), PHP_EOL;print_r(unpack('n*', $s));bfffffff
这个值转换出来应该是 -65,php弱类型会自动当作一个长整型处理,你看下windows计算器
$n = 0xFFFFFFBF;$s = pack('L', $n);print_r(unpack('l', $s));Array