3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $big = -1 * PHP_INT_MAX; echo bin2hex(pack('P', $big)); echo "\n"; $packed = pack('VV', $big & 0x00000000ffffffff, ($big & 0xffffffff00000000) >> 32); $bin = bin2hex($packed); echo $bin."\n"; $d = unpack('V2', $packed); echo str_pad(base_convert($d[2], 10, 16), 8, '0', STR_PAD_LEFT).str_pad(base_convert($d[1], 10, 16), 8, '0', STR_PAD_LEFT);
based on P940c
Output for 5.6.7 - 7.3.0beta1
0100000000000080 0100000000000080 8000000000000001
Output for 5.3.18 - 5.5.35
Warning: pack(): Type P: unknown format code in /in/62jsj on line 3 0100000000000080 8000000000000001