3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hash_pbkdf2_reg($a = 'sha256', $password, $salt, $rounds = 5000, $key_length = 32, $raw_output = false) { // Derived key $dk = ''; // Create key for ($block=1; $block<=$key_length; $block++) { // Initial hash for this block $ib = $h = hash_hmac($a, $salt . pack('N', $block), $password, true); // Perform block iterations for ($i=1; $i<$rounds; $i++) { // XOR each iteration $ib ^= ($h = hash_hmac($a, $h, $password, true)); } // Append iterated block $dk .= $ib; } // Return derived key of correct length $key = substr($dk, 0, $key_length); return $raw_output ? $key : base64_encode($key); } $salt = '1234567890123456'; $iterations = 200000; $length = 256; $hash1 = hash_pbkdf2_reg('sha256', 'plnlrtfpijpuhqylxbgqiiyipieyxvfsavzgxbbcfusqkozwpngsyejqlmjsytrmd', $salt, $iterations, $length);

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.60.0071.99716.75
8.3.50.0131.98722.82
8.3.40.0131.98818.89
8.3.30.0201.98219.04
8.3.20.0031.99820.16
8.3.10.0031.99923.66
8.3.00.0031.99919.25
8.2.180.0071.99618.29
8.2.170.0071.99722.96
8.2.160.0032.00020.52
8.2.150.0101.99224.18
8.2.140.0071.99524.66
8.2.130.0071.99426.16
8.2.120.0071.99621.04
8.2.110.0031.99922.12
8.2.100.0032.00118.03
8.2.90.0071.99419.40
8.2.80.0071.99417.97
8.2.70.0002.00417.63
8.2.60.0002.00218.05
8.2.50.0071.99618.07
8.2.40.0071.99018.34
8.2.30.0101.99318.08
8.2.20.0032.00217.89
8.2.10.0071.99418.08
8.2.00.0002.00217.82
8.1.280.0071.99825.92
8.1.270.0071.99622.24
8.1.260.0031.99926.35
8.1.250.0031.99928.09
8.1.240.0002.00423.67
8.1.230.0031.99919.07
8.1.220.0002.00217.79
8.1.210.0031.99918.77
8.1.200.0071.99817.35
8.1.190.0032.00017.12
8.1.180.0002.00418.10
8.1.170.0032.00618.65
8.1.160.0071.99521.95
8.1.150.0031.99918.83
8.1.140.0071.99417.46
8.1.130.0071.99417.80
8.1.120.0002.00217.36
8.1.110.0031.99817.49
8.1.100.0071.99417.47
8.1.90.0032.00017.45
8.1.80.0002.00217.45
8.1.70.0101.99217.41
8.1.60.0002.00217.61
8.1.50.0002.00317.59
8.1.40.0032.00117.55
8.1.30.0002.00217.70
8.1.20.0071.99717.63
8.1.10.0002.00417.49
8.1.00.0032.00117.55
8.0.300.0031.99818.77
8.0.290.0031.99916.75
8.0.280.0031.99718.39
8.0.270.0032.00217.21
8.0.260.0032.00017.20
8.0.250.0002.00416.94
8.0.240.0002.00216.95
8.0.230.0002.00216.92
8.0.220.0031.99916.83
8.0.210.0002.00616.84
8.0.200.0031.99816.89
8.0.190.0071.99616.88
8.0.180.0002.00216.90
8.0.170.0071.99516.88
8.0.160.0031.99816.96
8.0.150.0131.98616.82
8.0.140.0071.99616.91
8.0.130.0031.99813.32
8.0.120.0002.00216.77
8.0.110.0002.00216.78
8.0.100.0031.99916.75
8.0.90.0031.99816.80
8.0.80.0101.99116.83
8.0.70.0002.00216.72
8.0.60.0071.99716.69
8.0.50.0002.00216.69
8.0.30.0151.98817.10
8.0.20.0151.99617.40
8.0.10.0071.99716.75
8.0.00.0121.99116.57
7.4.330.0031.99415.00
7.4.320.0032.00116.34
7.4.300.0002.00316.49
7.4.290.0031.99816.50
7.4.280.0071.99316.48
7.4.270.0031.99916.50
7.4.260.0071.99516.45
7.4.250.0031.99816.46
7.4.240.0022.00116.38
7.4.230.0032.00116.59
7.4.220.0061.99416.35
7.4.210.0131.98816.51
7.4.200.0031.99816.59
7.4.160.0171.98016.38
7.4.150.0072.00817.40
7.4.140.0131.98817.86
7.4.130.0101.98716.39
7.4.120.0111.98816.49
7.4.110.0102.47116.54
7.4.100.0162.42316.28
7.4.90.0162.44616.49
7.4.80.0162.42419.39
7.4.70.0422.39916.44
7.4.60.0232.44116.46
7.4.50.0032.49616.33
7.4.40.0202.38316.32
7.4.30.0262.36816.50
7.4.00.0102.48714.88
7.3.330.0541.96213.23
7.3.320.0271.98213.43
7.3.310.0071.99716.28
7.3.300.0002.00216.18
7.3.290.0101.99316.15
7.3.280.0121.99016.23
7.3.270.0101.99317.40
7.3.260.0351.92516.26
7.3.250.0111.99116.28
7.3.240.0191.98516.23
7.3.230.0162.46216.39
7.3.210.0232.46116.21
7.3.200.0162.41519.39
7.3.190.0162.44616.14
7.3.180.0232.39516.35
7.3.170.0132.43616.27
7.3.160.0232.42216.65
7.2.330.0102.45616.66
7.2.320.0132.45416.46
7.2.310.0232.33016.71
7.2.300.0132.28816.50
7.2.290.0292.30016.54
7.2.110.0232.36116.46
7.2.00.0032.49819.31
7.1.200.0032.49215.85
7.1.100.0072.49518.09
7.1.70.0102.49117.13
7.1.60.0102.49119.40
7.1.50.0002.50117.12
7.1.00.0102.49022.27
7.0.200.0072.49415.14
7.0.140.0002.50022.18
7.0.60.0132.48719.97
7.0.50.0072.49317.79
7.0.40.0072.49319.71
7.0.30.0272.47319.98
7.0.20.0432.45719.97
7.0.10.0102.49019.72
7.0.00.0102.49019.72
5.6.280.0072.49320.89
5.6.210.0102.49020.47
5.6.200.0032.49718.15
5.6.190.0172.48320.46
5.6.180.0202.48020.37
5.6.170.0172.48320.39
5.6.160.0102.49020.43
5.6.150.0102.49018.14
5.6.140.0032.49718.14
5.6.130.0172.48318.15
5.6.120.0132.48721.02
5.6.110.0172.46321.02
5.6.100.0072.49321.00
5.6.90.2332.26320.98
5.6.80.0132.48720.48
5.5.350.0232.47720.36
5.5.340.0072.49318.03
5.5.330.0172.48320.23
5.5.320.0332.46720.13
5.5.310.0372.46320.20
5.5.300.0132.48717.98
5.5.290.0072.49317.92
5.5.280.0102.49020.88
5.5.270.0032.49720.88
5.5.260.0102.49020.65
5.5.250.0002.50020.49
5.5.240.0002.50020.04
5.4.450.0932.39719.32
5.4.440.0872.36719.53
5.4.430.0601.97019.53
5.4.420.0772.42019.36
5.4.410.0132.48018.95
5.4.400.0502.44318.51
5.4.390.0402.45318.50
5.4.380.0132.43318.59
5.4.370.0172.43718.70
5.4.360.0102.18318.52
5.4.350.0092.00812.02
5.4.340.0082.01512.02
5.4.320.0081.99512.50
5.4.310.0081.99612.50
5.4.300.0081.99312.50
5.4.290.0101.99412.50
5.4.280.0121.98912.40
5.4.270.0102.00112.40
5.4.260.0151.98612.39
5.4.250.0101.99312.40
5.4.240.0072.00312.40
5.4.230.0131.99212.39
5.4.220.0071.99412.39
5.4.210.0081.99512.39
5.4.200.0111.99012.39
5.4.190.0121.99312.39
5.4.180.0121.99012.39
5.4.170.0121.99012.39
5.4.160.0121.98812.39
5.4.150.0151.98612.39
5.4.140.0081.99612.07
5.4.130.0181.98312.06
5.4.120.0071.99712.02
5.4.110.0091.99212.01
5.4.100.0051.99712.01
5.4.90.0181.98212.02
5.4.80.0111.98912.01
5.4.70.0091.99312.01
5.4.60.0061.99412.01
5.4.50.0111.99012.01
5.4.40.0101.99012.00
5.4.30.0111.99011.99
5.4.20.0071.99611.99
5.4.10.0091.99211.99
5.4.00.0061.99711.48
5.3.290.0131.98812.80
5.3.280.0101.99412.71
5.3.270.0091.99112.73
5.3.260.0061.99412.72
5.3.250.0121.99112.72
5.3.240.0141.98812.72
5.3.230.0131.98812.71
5.3.220.0081.99212.68
5.3.210.0091.99312.68
5.3.200.0051.99512.68
5.3.190.0091.99612.68
5.3.180.0071.99412.68
5.3.170.0151.98712.67
5.3.160.0121.99012.68
5.3.150.0151.98612.67
5.3.140.0081.99512.66
5.3.130.0171.98512.66
5.3.120.0081.99112.66
5.3.110.0131.98912.65
5.3.100.0121.98812.11
5.3.90.0061.99412.08
5.3.80.0061.99512.08
5.3.70.0091.99212.07
5.3.60.0061.99512.07
5.3.50.0061.99512.00
5.3.40.0101.99412.00
5.3.30.0171.98311.94
5.3.20.0051.99511.73
5.3.10.0061.99411.69
5.3.00.0061.99311.68
5.2.170.0051.9959.17
5.2.160.0081.9939.16
5.2.150.0061.9949.17
5.2.140.0141.9889.16
5.2.130.0071.9929.12
5.2.120.0081.9939.12
5.2.110.0032.0009.13
5.2.100.0131.9919.12
5.2.90.0071.9939.11
5.2.80.0071.9959.11
5.2.70.0081.9909.12
5.2.60.0061.9969.07
5.2.50.0051.9979.04
5.2.40.0211.9849.02
5.2.30.0231.9798.99
5.2.20.0091.9908.98
5.2.10.0062.0008.89
5.2.00.0051.9958.76
5.1.60.0061.9978.03
5.1.50.0101.9918.03
5.1.40.0031.9968.02
5.1.30.0101.9918.36
5.1.20.0081.9948.38
5.1.10.0030.0278.16
5.1.00.0040.0258.16
5.0.50.0010.0236.66
5.0.40.0040.0196.52
5.0.30.0040.0306.33
5.0.20.0020.0206.30
5.0.10.0010.0216.28
5.0.00.0040.0296.27
4.4.90.0040.0134.78
4.4.80.0020.0174.75
4.4.70.0020.0174.76
4.4.60.0030.0154.75
4.4.50.0030.0144.77
4.4.40.0010.0264.71
4.4.30.0040.0144.76
4.4.20.0020.0164.85
4.4.10.0030.0154.85
4.4.00.0030.0254.76
4.3.110.0010.0214.67
4.3.100.0010.0164.67
4.3.90.0030.0144.64
4.3.80.0020.0254.58
4.3.70.0010.0164.63
4.3.60.0030.0134.63
4.3.50.0030.0144.63
4.3.40.0030.0234.54
4.3.30.0010.0163.32
4.3.20.0010.0163.30
4.3.10.0040.0133.25
4.3.00.0230.0207.20

preferences:
47.62 ms | 400 KiB | 5 Q