3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function encode($int) { $int = round($int); $left = 0xffffffff00000000; $right = 0x00000000ffffffff; $l = ($int & $left) >>32; $r = $int & $right; return unpack('d', pack('NN', $l, $r))[1]; } function decode($float){ $set = unpack('N2', pack('d', $float)); return $set[1] << 32 | $set[2]; } $float = encode(10000000000000); decode($float) decode(1.1710299640683E-305);
Output for 5.4.0 - 5.4.29
Parse error: syntax error, unexpected 'decode' (T_STRING) in /in/d8m17 on line 22
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected '[' in /in/d8m17 on line 11
Process exited with code 255.