- var_dump: documentation ( source)
- array_values: documentation ( source)
- pack: documentation ( source)
- unpack: documentation ( source)
<?php
$value = 15;
$highMap = 0xffffffff00000000;
$lowMap = 0x00000000ffffffff;
$higher = ($value & $highMap) >>32;
$lower = $value & $lowMap;
$packed = pack('NN@64', $higher, $lower);
list($higher, $lower) = array_values(unpack('N2', $packed));
$originalValue = $higher << 32 | $lower;
var_dump($originalValue);
var_dump($originalValue == $value);