<?php $masks = [1,2,4,8,16,32,64]; $num = 0x07; // get the parity bit $pBit = $num & 1; // shift it off $num = $num >> 1; $p = 0; echo "Num is $num\n"; foreach ($masks as $mask){ if ($mask & $num){ $p++; } } echo "On Bits = $p\n"; echo "Paroty Should be ".($p%2?0:1)."\n"; echo "Actual $pBit \n";
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`