dsfsfsfsfs55656 2019-04-20 04:15
浏览 157

为什么chr()函数适用于有效范围(0 ... 255)之外的少数字节值而不适用于其他字节值?

I'm using PHP 7.3.4 on my home machine that runs on Windows 10 Home Single Language 64-bit operating system.

I come across below statement from PHP Manual:

Values outside the valid range (0..255) will be bitwise and'ed with 255, which is equivalent to the following algorithm:

while ($bytevalue < 0) {
    $bytevalue += 256; } 
$bytevalue %= 256;

I'm able to print the single character string for bytevalue which is outside the valid range i.e. outside(0...255) using the built-in chr() function.

But for few values like chr(-598), chr(-813), chr(-1059), etc. it's displaying the character. Why it's not displaying the relevant character specific to the newly calculated bytevalue according to the above algorithm?

I also want to know from where this came as it's not been present in any of the ASCCI compatible character encodings?

Please help me out in this regard.

Thank You.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
    • ¥20 有关区间dp的问题求解
    • ¥15 多电路系统共用电源的串扰问题
    • ¥15 slam rangenet++配置
    • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
    • ¥15 对于相关问题的求解与代码
    • ¥15 ubuntu子系统密码忘记
    • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
    • ¥15 保护模式-系统加载-段寄存器
    • ¥15 电脑桌面设定一个区域禁止鼠标操作