1. // assume we have 52 bits of data, little endian.
  2. $bytes = "\x12\x34\x56\x78\x9a\xbc\x0d\x00";
  3. // ^ ^^ 12 bits of padding.
  4.  
  5. $parts = unpack('V2', $bytes);
  6.  
  7. $theNumber = $parts[1] + pow(2.0, 32) * $parts[2]; // <-- this is precise.
  8. $theNumber /= pow(2.0, 52); // <-- this is precise.