3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* convert 64-bit numeric string to decimal */ function showDecimal( $bin, $base ) { if ($bin[0] == 'F' && $bin[1] == 'F'){ $bin = substr($bin,1); // trim string so may } $num = intval( $bin, $base ); // convert to binary number $num &= 0xffff; // using only rightmost 16 bits if ( 0x8000 & $num ) { // true if $num is negative ... $num =( $num - (2 ** 16) ); $num2 = -((2 ** 16) - 0xfffd); var_dump($num2); } return $num; } $c = "FFFFFFFFFFFFFFFD"; // TC in hexadecimal for: echo showDecimal($c,16),"\n"; // -3
Output for git.master, git.master_jit, rfc.property-hooks
int(-3) -3

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