code: protected function binaryPopCount($value)
      {
          $value -= (($value >> 1) & 0x55555555);
          $value = ((($value >> 2) & 0x33333333) + ($value & 0x33333333));
          $value = ((($value >> 4) + $value) & 0x0f0f0f0f);
          $value += ($value >> 8);
          $value += ($value >> 16);
          return $value & 0x0000003f;
      }
docs: Count the number of bits set in a 32bits integer
  @param int $value
  @return int