3v4l.org

run code in 300+ PHP versions simultaneously
<?php function OTP($input, $pad) { $inputlen = strlen($input); $padlen = strlen($pad); $inputbytes = unpack("C*", $input); //Pack C* will convert a string into a byte array, such as 'abc' to Array(0x61, 0x62, 0x63) $padbytes = unpack("C*", $pad); $output = ""; for($i = 0; $i < $inputlen; $i++) //Loop through the input string $output .= chr($inputbytes[$i] ^ $padbytes[$i % $padlen]); return $output; } var_dump(unpack("C*", "ABC"));

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.3.70.0090.00918.31
8.3.60.0130.00717.95
8.3.50.0130.00822.03
8.3.40.0110.00618.32
8.3.30.0150.00618.83
8.3.20.0080.00020.19
8.3.10.0050.00323.48
8.3.00.0000.00819.23
8.2.190.0040.01116.58
8.2.180.0060.00918.04
8.2.170.0150.00022.96
8.2.160.0000.01522.19
8.2.150.0060.00324.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0030.00519.55
8.2.110.0040.00419.30
8.2.100.0040.00817.78
8.2.90.0040.00420.47
8.2.80.0060.00317.97
8.2.70.0050.00317.68
8.2.60.0040.00417.97
8.2.50.0030.00618.10
8.2.40.0050.00219.21
8.2.30.0000.00719.12
8.2.20.0040.00417.51
8.2.10.0040.00417.99
8.2.00.0040.00417.61
8.1.280.0120.00625.92
8.1.270.0060.00318.78
8.1.260.0060.00926.35
8.1.250.0070.00028.09
8.1.240.0070.00423.79
8.1.230.0040.00820.90
8.1.220.0000.00817.74
8.1.210.0000.00818.91
8.1.200.0090.00017.22
8.1.190.0050.00317.00
8.1.180.0040.00418.10
8.1.170.0040.00418.78
8.1.160.0000.00718.69
8.1.150.0040.00418.73
8.1.140.0060.00317.33
8.1.130.0000.00717.77
8.1.120.0000.00717.33
8.1.110.0030.00517.36
8.1.100.0000.00717.28
8.1.90.0050.00217.24
8.1.80.0040.00417.31
8.1.70.0030.00317.29
8.1.60.0000.00817.44
8.1.50.0040.00417.30
8.1.40.0040.00417.41
8.1.30.0030.00617.40
8.1.20.0000.00717.39
8.1.10.0080.00017.29
8.1.00.0070.00017.29
8.0.300.0060.00319.85
8.0.290.0040.00416.63
8.0.280.0040.00418.31
8.0.270.0000.00717.13
8.0.260.0000.00617.13
8.0.250.0000.00716.76
8.0.240.0030.00316.70
8.0.230.0000.00716.80
8.0.220.0000.00716.74
8.0.210.0070.00016.76
8.0.200.0030.00616.80
8.0.190.0000.00716.82
8.0.180.0000.00716.84
8.0.170.0000.00816.80
8.0.160.0040.00416.79
8.0.150.0040.00416.73
8.0.140.0080.00016.72
8.0.130.0030.00313.21
8.0.120.0080.00016.75
8.0.110.0050.00216.77
8.0.100.0040.00416.76
8.0.90.0040.00416.66
8.0.80.0060.00916.65
8.0.70.0000.00716.77
8.0.60.0040.00416.63
8.0.50.0000.00716.82
8.0.30.0090.01116.90
8.0.20.0080.01317.40
8.0.10.0000.00916.77
8.0.00.0080.01116.52
7.4.330.0000.00515.03
7.4.320.0000.00616.46
7.4.300.0000.00616.52
7.4.290.0000.00716.46
7.4.280.0040.00416.30
7.4.270.0000.00716.52
7.4.260.0040.00416.47
7.4.250.0000.00716.43
7.4.240.0000.00816.41
7.4.230.0040.00416.13
7.4.220.0160.00916.32
7.4.210.0080.01216.49
7.4.200.0050.00216.47
7.4.160.0120.00416.42
7.4.150.0110.00717.40
7.4.140.0120.00517.86
7.4.130.0150.00516.36
7.4.120.0050.01216.51
7.4.110.0120.01116.42
7.4.100.0100.01316.22
7.4.90.0060.01116.35
7.4.80.0150.00619.39
7.4.70.0100.00616.31
7.4.60.0130.00316.45
7.4.50.0000.00816.43
7.4.40.0140.00316.36
7.4.30.0140.00316.30
7.4.00.0070.00814.68
7.3.330.0020.00213.14
7.3.320.0050.00012.98
7.3.310.0000.00716.00
7.3.300.0000.00716.13
7.3.290.0120.00516.15
7.3.280.0090.00916.17
7.3.270.0080.00817.40
7.3.260.0040.01316.50
7.3.250.0120.00516.38
7.3.240.0100.00616.17
7.3.230.0080.01116.39
7.3.210.0100.01016.13
7.3.200.0070.01016.21
7.3.190.0120.00916.20
7.3.180.0090.00716.20
7.3.170.0150.00616.32
7.3.160.0030.01216.14
7.3.120.0030.01514.67
7.3.110.0040.01314.76
7.3.100.0040.01114.62
7.3.90.0090.00914.48
7.3.80.0070.00714.81
7.3.70.0080.00414.58
7.3.60.0100.00714.58
7.3.50.0130.00314.66
7.3.40.0030.01014.71
7.3.30.0000.00814.75
7.3.20.0120.00616.73
7.3.10.0070.00416.34
7.3.00.0150.00016.57
7.2.330.0120.00616.57
7.2.320.0170.00616.31
7.2.310.0070.01016.60
7.2.300.0130.00616.32
7.2.290.0170.00616.41
7.2.250.0030.01614.74
7.2.240.0090.01214.97
7.2.230.0120.00314.69
7.2.220.0000.01414.98
7.2.210.0090.00614.73
7.2.200.0040.01214.69
7.2.190.0030.01314.79
7.2.180.0040.00814.85
7.2.170.0030.01014.63
7.2.00.0100.00319.23
7.1.330.0040.01215.80
7.1.320.0030.01315.77
7.1.310.0070.00715.77
7.1.300.0070.01015.60
7.1.290.0100.00615.77
7.1.280.0000.01415.41
7.1.270.0030.00715.63
7.1.260.0000.01315.52
7.1.200.0070.00715.81
7.1.100.0040.00817.93
7.1.70.0000.00817.03
7.1.60.0070.01819.22
7.1.50.0030.01616.56
7.1.00.0030.07722.33
7.0.200.0050.00216.75
7.0.140.0070.06721.92
7.0.110.0670.08720.08
7.0.100.0670.05720.03
7.0.90.0870.07719.94
7.0.80.0870.08019.93
7.0.70.0600.07320.01
7.0.60.0770.05319.87
7.0.50.0630.05719.90
7.0.40.0130.07019.88
7.0.30.0030.08719.65
7.0.20.0100.07019.87
7.0.10.0170.07019.88
7.0.00.0130.07019.77
5.6.280.0100.06720.80
5.6.260.0100.08020.75
5.6.250.0070.08020.69
5.6.240.0130.08020.57
5.6.230.0030.08320.55
5.6.220.0070.07320.70
5.6.210.0100.08020.73
5.6.200.0070.08320.56
5.6.190.0100.07720.64
5.6.180.0070.06720.57
5.6.170.0130.08020.56
5.6.160.0000.09020.70
5.6.150.0000.08720.67
5.6.140.0070.05720.65
5.6.130.0100.07020.56
5.6.120.0030.09020.61
5.6.110.0130.08020.64
5.6.100.0130.07720.46
5.6.90.0070.05020.66
5.6.80.0000.04720.24
5.6.70.0030.08019.94
5.6.60.0070.07020.07
5.6.50.0030.04719.95
5.6.40.0100.05719.98
5.6.30.0030.04319.92
5.6.20.0130.02720.06
5.6.10.0170.07319.92
5.6.00.0030.07020.04
5.5.380.0070.08320.57
5.5.370.0070.07720.58
5.5.360.0100.07720.44
5.5.350.0100.08720.16
5.5.340.0030.09020.89
5.5.330.0130.07720.81
5.5.320.0070.08020.87
5.5.310.0100.08020.84
5.5.300.0100.08020.70
5.5.290.0030.05720.86
5.5.280.0030.08720.80
5.5.270.0070.08720.86
5.5.260.0070.07021.01
5.5.250.0000.08020.65
5.5.240.0130.07020.27
5.5.230.0070.03720.12
5.5.220.0070.07020.39
5.5.210.0100.04720.39
5.5.200.0000.04720.37
5.5.190.0100.04320.21
5.5.180.0070.04020.21
5.5.160.0070.08020.05
5.5.150.0100.03020.21
5.5.140.0070.07320.18
5.5.130.0000.04020.13
5.5.120.0100.05720.29
5.5.110.0100.07720.11
5.5.100.0070.03320.05
5.5.90.0100.03019.98
5.5.80.0100.03020.07
5.5.70.0170.07720.26
5.5.60.0070.06720.09
5.5.50.0030.05720.14
5.5.40.0030.04320.21
5.5.30.0070.04320.03
5.5.20.0000.04320.12
5.5.10.0070.04020.11
5.5.00.0030.04720.22
5.4.450.0030.07719.42
5.4.440.0100.08019.33
5.4.430.0070.08019.47
5.4.420.0070.08319.55
5.4.410.0130.07019.23
5.4.400.0100.07719.34
5.4.390.0130.03719.00
5.4.380.0030.03718.99
5.4.370.0000.04019.02
5.4.360.0070.03319.02
5.4.350.0030.03319.18
5.4.340.0000.06719.31
5.4.320.0100.07019.02
5.4.310.0030.03719.19
5.4.300.0070.06019.00
5.4.290.0100.04019.00
5.4.280.0030.06319.23
5.4.270.0100.07319.00
5.4.260.0070.05319.34
5.4.250.0070.03318.96
5.4.240.0130.05319.30
5.4.230.0100.03319.34
5.4.220.0000.05319.02
5.4.210.0030.03719.08
5.4.200.0030.03719.02
5.4.190.0070.03319.16
5.4.180.0000.03719.17
5.4.170.0030.04019.17
5.4.160.0000.04019.16
5.4.150.0000.04319.17
5.4.140.0030.03716.39
5.4.130.0030.03316.29
5.4.120.0030.03316.35
5.4.110.0070.04316.47
5.4.100.0070.03716.44
5.4.90.0000.03716.51
5.4.80.0100.06716.39
5.4.70.0000.04316.45
5.4.60.0070.03316.24
5.4.50.0030.03316.39
5.4.40.0030.04016.47
5.4.30.0000.04316.51
5.4.20.0070.04016.56
5.4.10.0070.07716.54
5.4.00.0030.07315.83
5.3.290.0070.04014.68
5.3.280.0000.04014.73
5.3.270.0030.03714.66
5.3.260.0000.03714.83
5.3.250.0000.04314.73
5.3.240.0000.04014.83
5.3.230.0070.06714.73
5.3.220.0000.04714.58
5.3.210.0000.04014.65
5.3.200.0070.03014.54
5.3.190.0070.03714.55
5.3.180.0070.03314.56
5.3.170.0130.02314.59
5.3.160.0070.04014.69
5.3.150.0000.04014.57
5.3.140.0030.03314.69
5.3.130.0030.03714.55
5.3.120.0030.05014.63
5.3.110.0070.07014.54
5.3.100.0100.07314.17
5.3.90.0070.07014.15
5.3.80.0100.06714.24
5.3.70.0100.07714.01
5.3.60.0030.06314.11
5.3.50.0030.08014.00
5.3.40.0170.06713.97
5.3.30.0100.04013.91
5.3.20.0070.04713.66
5.3.10.0030.07313.69
5.3.00.0070.07313.87
5.2.170.0030.05712.46
5.2.160.0030.06312.46
5.2.150.0030.06312.46
5.2.140.0100.06012.46
5.2.130.0100.05712.46
5.2.120.0030.06312.46
5.2.110.0030.03712.46
5.2.100.0030.06012.46
5.2.90.0100.05712.46
5.2.80.0100.05712.46
5.2.70.0030.06712.46
5.2.60.0130.05712.46
5.2.50.0070.06012.46
5.2.40.0030.06312.46
5.2.30.0070.06012.46
5.2.20.0030.06012.46
5.2.10.0030.06012.46
5.2.00.0070.04012.46
5.1.60.0130.04712.46
5.1.50.0030.05312.46
5.1.40.0000.05712.46
5.1.30.0130.05712.46
5.1.20.0100.05012.46
5.1.10.0100.05312.46
5.1.00.0030.05312.46
5.0.50.0000.04712.46
5.0.40.0030.03312.46
5.0.30.0100.05012.46
5.0.20.0070.04012.46
5.0.10.0000.04712.46
5.0.00.0070.06312.46
4.4.90.0000.03712.46
4.4.80.0130.02312.46
4.4.70.0070.02312.46
4.4.60.0030.03712.46
4.4.50.0000.03712.46
4.4.40.0070.05012.46
4.4.30.0030.03012.46
4.4.20.0070.03312.46
4.4.10.0030.01712.46
4.4.00.0000.06012.46
4.3.110.0070.03312.46
4.3.100.0000.03712.46
4.3.90.0000.03312.46
4.3.80.0070.04312.46
4.3.70.0000.03712.46
4.3.60.0000.03012.46
4.3.50.0000.03712.46
4.3.40.0030.03712.46
4.3.30.0030.02312.46
4.3.20.0000.02312.46
4.3.10.0000.03712.46
4.3.00.0030.03312.46

preferences:
44.96 ms | 401 KiB | 5 Q