3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s1 = bchexdec('44e1ff2dfd8102cf7a47c21d5c9fd5701610d04953c6836596b4fe9dd2f53e3e'); $s2 = bchexdec('9a5f1c75e461d7ceb1cf3cab9013eb2dc85b6d0da8c3c6e27e3a5a5b3faa5bab'); echo bcdechex(invmod($s1, -$s2)); function invmod($a,$b) { $n=$b; $x=0; $lx=1; $y=1; $ly=0; while ($b) { $t=$b; $q=bcdiv($a,$b,0); $b=bcmod($a,$b); $a=$t; $t=$x; $x=bcsub($lx,bcmod(bcmul($q,$x),$n)); $lx=$t; $t=$y; $y=bcsub($ly,bcmod(bcmul($q,$y),$n)); $ly=$t; } if (bccomp($lx,0) == -1) $lx=bcadd($lx,$n); return $lx; } function bchexdec($hex) { if(strlen($hex) == 1) { return hexdec($hex); } else { $remain = substr($hex, 0, -1); $last = substr($hex, -1); return bcadd(bcmul(16, bchexdec($remain)), hexdec($last)); } } function bcdechex($dec) { $last = bcmod($dec, 16); $remain = bcdiv(bcsub($dec, $last), 16); if($remain == 0) { return dechex($last); } else { return bcdechex($remain).dechex($last); } }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.4.20.0120.00917.68
8.4.10.0060.01317.77
8.3.150.0060.01217.16
8.3.140.0050.00316.66
8.3.130.0060.00316.93
8.3.120.0060.00320.66
8.3.110.0080.00420.94
8.3.100.0030.00516.89
8.3.90.0070.01126.77
8.3.80.0070.00318.68
8.3.70.0130.00618.43
8.3.60.0120.00616.75
8.3.50.0080.01022.84
8.3.40.0150.00018.92
8.3.30.0070.00719.17
8.3.20.0080.00020.31
8.3.10.0030.00520.64
8.3.00.0080.00020.76
8.2.260.0150.00418.87
8.2.250.0030.00618.48
8.2.240.0090.00017.09
8.2.230.0100.00022.58
8.2.220.0090.00024.06
8.2.210.0120.00326.77
8.2.200.0060.00318.68
8.2.190.0110.00416.75
8.2.180.0110.00718.54
8.2.170.0080.00822.96
8.2.160.0060.00919.02
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00419.48
8.2.110.0030.00522.21
8.2.100.0000.01217.71
8.2.90.0030.00519.22
8.2.80.0030.00619.33
8.2.70.0040.00417.48
8.2.60.0080.00018.03
8.2.50.0060.00318.07
8.2.40.0000.00818.22
8.2.30.0020.00521.14
8.2.20.0040.00417.70
8.2.10.0080.00018.11
8.2.00.0030.00517.88
8.1.310.0120.00618.68
8.1.300.0000.00918.32
8.1.290.0090.00030.84
8.1.280.0150.00025.92
8.1.270.0030.00623.97
8.1.260.0080.00026.35
8.1.250.0030.00528.09
8.1.240.0040.00722.55
8.1.230.0040.00821.01
8.1.220.0000.00818.77
8.1.210.0050.00319.03
8.1.200.0100.00017.48
8.1.190.0040.00417.76
8.1.180.0030.00618.10
8.1.170.0000.00818.62
8.1.160.0000.00819.01
8.1.150.0030.00518.95
8.1.140.0060.00317.52
8.1.130.0030.00617.95
8.1.120.0000.00717.53
8.1.110.0080.00017.52
8.1.100.0040.00417.54
8.1.90.0040.00417.43
8.1.80.0040.00417.46
8.1.70.0000.00717.37
8.1.60.0040.00417.53
8.1.50.0000.00817.49
8.1.40.0000.00817.61
8.1.30.0030.00617.78
8.1.20.0000.00817.73
8.1.10.0090.00017.63
8.1.00.0050.00317.62
8.0.300.0040.00420.02
8.0.290.0040.00417.16
8.0.280.0000.00718.42
8.0.270.0040.00417.37
8.0.260.0000.00617.32
8.0.250.0000.00716.99
8.0.240.0030.00517.02
8.0.230.0030.00316.91
8.0.220.0040.00416.97
8.0.210.0040.00417.00
8.0.200.0030.00317.06
8.0.190.0000.00817.00
8.0.180.0070.00016.88
8.0.170.0040.00416.89
8.0.160.0000.00716.92
8.0.150.0030.00717.00
8.0.140.0040.00416.80
8.0.130.0000.00613.39
8.0.120.0060.00316.80
8.0.110.0000.00716.88
8.0.100.0020.00517.05
8.0.90.0030.00316.89
8.0.80.0170.00017.01
8.0.70.0060.00316.90
8.0.60.0050.00316.88
8.0.50.0040.00416.93
8.0.30.0090.01117.18
8.0.20.0090.01317.40
8.0.10.0050.00317.02
8.0.00.0080.01116.82
7.4.330.0050.00015.21
7.4.320.0000.00616.59
7.4.300.0070.00016.57
7.4.290.0030.00316.47
7.4.280.0000.00816.65
7.4.270.0020.00516.65
7.4.260.0000.00716.47
7.4.250.0040.00416.39
7.4.240.0040.00316.52
7.4.230.0070.00016.68
7.4.220.0090.00916.70
7.4.210.0090.00616.58
7.4.200.0000.00716.77
7.4.160.0060.01016.74
7.4.150.0110.01017.40
7.4.140.0110.00717.86
7.4.130.0140.00716.63
7.4.120.0130.00516.62
7.4.110.0060.01216.56
7.4.100.0090.01016.69
7.4.90.0120.00416.70
7.4.80.0100.01319.39
7.4.70.0110.00816.71
7.4.60.0070.01016.62
7.4.50.0030.00616.43
7.4.40.0080.01216.57
7.4.30.0050.01316.63
7.4.00.0130.00315.01
7.3.330.0030.00313.35
7.3.320.0060.00013.36
7.3.310.0000.00716.59
7.3.300.0000.00716.34
7.3.290.0040.01216.48
7.3.280.0100.00716.45
7.3.270.0100.00717.40
7.3.260.0100.00716.48
7.3.250.0100.00816.58
7.3.240.0100.00616.68
7.3.230.0000.01716.69
7.3.210.0140.00316.41
7.3.200.0140.00319.39
7.3.190.0140.00416.43
7.3.180.0040.01616.77
7.3.170.0150.00916.45
7.3.160.0110.01116.53
7.2.330.0040.01316.43
7.2.320.0090.00916.63
7.2.310.0160.00616.69
7.2.300.0100.01416.55
7.2.290.0060.01316.57
7.2.60.0060.00617.16
7.1.200.0000.01015.88
7.1.70.0030.00517.22
7.1.60.0100.01419.34
7.1.50.0000.02216.63
7.1.00.0070.07322.46
7.0.200.0000.01016.84
7.0.140.0070.03022.00
7.0.60.0070.04020.06
7.0.50.0030.07717.93
7.0.40.0030.08020.14
7.0.30.0530.07320.26
7.0.20.0200.05320.09
7.0.10.0330.06020.22
7.0.00.0030.08720.22
5.6.280.0030.07720.84
5.6.210.0030.07720.70
5.6.200.0070.08718.22
5.6.190.0070.04320.34
5.6.180.0100.08020.77
5.6.170.0370.04320.44
5.6.160.0070.07020.56
5.6.150.0070.03718.13
5.6.140.0070.05318.18
5.6.130.0170.07018.28
5.6.120.0030.07321.03
5.6.110.0170.06321.16
5.6.100.0030.04321.16
5.6.90.0070.04021.00
5.6.80.0000.04020.54
5.6.70.3770.04320.45
5.5.350.0030.06720.33
5.5.340.0100.03317.99
5.5.330.0030.09320.37
5.5.320.0070.08320.27
5.5.310.0200.05320.36
5.5.300.0070.04317.95
5.5.290.0070.08017.98
5.5.280.0130.03720.78
5.5.270.0070.05020.90
5.5.260.0100.05020.90
5.5.250.0000.05320.71
5.5.240.0130.07320.38
5.4.450.0600.03719.47
5.4.440.0370.04019.55
5.4.430.0500.03319.54
5.4.420.0170.05319.67
5.4.410.0070.05719.40
5.4.400.0100.05019.07
5.4.390.0170.05719.02
5.4.380.0130.06719.26
5.4.370.0100.05019.21
5.4.360.0070.05719.12
5.4.350.0050.03712.07
5.4.340.0050.04012.07
5.4.320.0040.03812.56
5.4.310.0080.04312.55
5.4.300.0080.04212.56
5.4.290.0070.04112.55
5.4.280.0080.03712.46
5.4.270.0090.03712.46
5.4.260.0030.04112.45
5.4.250.0070.03812.45
5.4.240.0060.03712.45
5.4.230.0070.04412.45
5.4.220.0060.04012.45
5.4.210.0080.03512.45
5.4.200.0090.03612.44
5.4.190.0090.05112.45
5.4.180.0090.03512.44
5.4.170.0100.04012.45
5.4.160.0070.03812.44
5.4.150.0060.03612.44
5.4.140.0090.04312.12
5.4.130.0110.04512.11
5.4.120.0120.04712.07
5.4.110.0050.04812.07
5.4.100.0080.05812.06
5.4.90.0070.04812.06
5.4.80.0080.04612.06
5.4.70.0050.03812.06
5.4.60.0110.04012.06
5.4.50.0070.04612.06
5.4.40.0080.03512.05
5.4.30.0050.03912.04
5.4.20.0080.05012.04
5.4.10.0050.04212.04
5.4.00.0130.04411.53
5.3.290.0080.04412.80
5.3.280.0070.03812.71
5.3.270.0090.03812.73
5.3.260.0070.04512.72
5.3.250.0090.03912.72
5.3.240.0070.04112.72
5.3.230.0080.04712.70
5.3.220.0080.05612.68
5.3.210.0070.04312.68
5.3.200.0080.04012.68
5.3.190.0090.03712.68
5.3.180.0060.04412.68
5.3.170.0090.03712.67
5.3.160.0050.04012.68
5.3.150.0070.04012.67
5.3.140.0060.03912.66
5.3.130.0090.04012.66
5.3.120.0050.05312.66
5.3.110.0060.04612.66
5.3.100.0120.04712.14
5.3.90.0050.05312.12
5.3.80.0040.04012.12
5.3.70.0060.04412.11
5.3.60.0130.03712.10
5.3.50.0090.04212.05
5.3.40.0070.03612.05
5.3.30.0070.03612.01
5.3.20.0070.04311.79
5.3.10.0050.03811.75
5.3.00.0060.04711.74
5.2.170.0070.0299.32
5.2.160.0050.0319.32
5.2.150.0080.0369.32
5.2.140.0070.0349.32
5.2.130.0050.0409.27
5.2.120.0050.0309.27
5.2.110.0060.0339.28
5.2.100.0040.0319.27
5.2.90.0010.0339.28
5.2.80.0090.0289.27
5.2.70.0090.0299.27
5.2.60.0080.0379.24
5.2.50.0050.0339.20
5.2.40.0030.0319.18
5.2.30.0060.0419.15
5.2.20.0080.0409.14
5.2.10.0090.0359.06
5.2.00.0050.0328.93
5.1.60.0070.0328.21
5.1.50.0030.0288.21
5.1.40.0130.0288.19
5.1.30.0080.0338.55
5.1.20.0060.0338.56
5.1.10.0030.0318.29
5.1.00.0050.0258.29
5.0.50.0040.0216.79
5.0.40.0060.0186.65
5.0.30.0030.0336.46
5.0.20.0020.0226.45
5.0.10.0020.0236.42
5.0.00.0060.0326.42
4.4.90.0040.0234.98
4.4.80.0050.0154.96
4.4.70.0040.0194.95
4.4.60.0050.0154.96
4.4.50.0030.0184.97
4.4.40.0050.0244.97
4.4.30.0020.0204.96
4.4.20.0050.0155.02
4.4.10.0040.0155.03
4.4.00.0020.0304.99
4.3.110.0040.0154.79
4.3.100.0030.0154.77
4.3.90.0030.0224.77
4.3.80.0040.0324.77
4.3.70.0060.0194.77
4.3.60.0050.0204.77
4.3.50.0050.0164.76
4.3.40.0030.0264.71
4.3.30.0030.0203.52
4.3.20.0010.0213.63
4.3.10.0010.0233.45
4.3.00.0030.02013.47

preferences:
28.46 ms | 403 KiB | 5 Q