3v4l.org

run code in 300+ PHP versions simultaneously
<?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]; } echo decode(encode(10000000000000)).'<br><br>'; $float = encode(10000000000000); echo $float.'<br>'; echo decode($float).'<br>'; echo decode(1.1710299640683E-305).'<br>';
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Implicit conversion from float 1.8446744069414584E+19 to int loses precision in /in/rThPd on line 8 10000000000000<br><br> Deprecated: Implicit conversion from float 1.8446744069414584E+19 to int loses precision in /in/rThPd on line 8 1.1710299640683E-305<br>10000000000000<br>-6629571225977708544<br>

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
40.4 ms | 402 KiB | 8 Q