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('N2', $l, $r))[1]; } function decode($float) { $set = unpack('N2', pack('d', $float)); return $set[1] << 32 | $set[2]; } echo decode(encode(10000000000000)); $float = encode(10000000000000); echo $float; echo decode($float); echo decode(1.1710299640683E-305);
Output for git.master, git.master_jit, rfc.property-hooks
Deprecated: Implicit conversion from float 1.8446744069414584E+19 to int loses precision in /in/MpNYj on line 8 10000000000000 Deprecated: Implicit conversion from float 1.8446744069414584E+19 to int loses precision in /in/MpNYj on line 8 1.1710299640683E-30510000000000000-6629571225977708544

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:
46.63 ms | 401 KiB | 8 Q