3v4l.org

run code in 300+ PHP versions simultaneously
<?php $max = 2 ** 31 - 1; $prime = 2123809381; $inverse = 59260789; $xor = 1163945558; $value = 3802099463828355; $encoded = ((int) ($value * $prime) & $max) ^ $xor; echo $encoded; echo (($value * $prime) & $max) ^ $xor; echo (int) (($value ^ $xor) * $inverse) & $max; echo (($value ^ $xor) * $inverse) & $max;
Output for 8.5.0 - 8.5.1
Warning: The float 8.07493450877373E+24 is not representable as an int, cast occurred in /in/P1Js3 on line 10 90203734 Warning: The float 8.07493450877373E+24 is not representable as an int, cast occurred in /in/P1Js3 on line 13 90203734 Warning: The float 2.253153530625348E+23 is not representable as an int, cast occurred in /in/P1Js3 on line 15 1543503872 Warning: The float 2.253153530625348E+23 is not representable as an int, cast occurred in /in/P1Js3 on line 17 1543503872
Output for 8.1.28 - 8.1.34, 8.2.16 - 8.2.30, 8.3.3 - 8.3.29, 8.4.1 - 8.4.14, 8.4.16
90203734 Deprecated: Implicit conversion from float 8.07493450877373E+24 to int loses precision in /in/P1Js3 on line 13 902037341543503872 Deprecated: Implicit conversion from float 2.253153530625348E+23 to int loses precision in /in/P1Js3 on line 17 1543503872
Output for 8.4.15
/bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libm.so.6: version `GLIBC_2.35' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.34' not found (required by /bin/php-8.4.15) /bin/php-8.4.15: /usr/lib/libc.so.6: version `GLIBC_2.38' not found (required by /bin/php-8.4.15)
Process exited with code 1.

preferences:
97.06 ms | 409 KiB | 5 Q