3v4l.org

run code in 300+ PHP versions simultaneously
<?php function deriveSP800108HmacSHA256Key($length, $array, $string, $array2) { $n = $n2 = 1; $allocate = []; // length = $length while ($n < $length) { $mac = hash_init('sha256', HASH_HMAC, $array); $allocate2 = pack("L", $n2); hash_update($mac, $allocate2); hash_update($mac, $string); hash_update($mac, pack("L", 0)); hash_update($mac, $array2); $allocate2 = pack("L", $n * 8); hash_update($mac, $allocate2); $final = hash_final($mac, true); $allocate .= $final; $n2++; } return $allocate; } var_dump(deriveSP800108HmacSHA256Key(32, 'array', 'foo', 'array2'));

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.0831.92348.14
8.3.60.0871.92048.48
8.3.50.0751.93048.20
8.3.40.0471.33636.50
8.3.30.0401.34936.29
8.3.20.0230.74837.80
8.3.10.0170.73539.27
8.3.00.0570.81636.59
8.2.190.0671.93649.64
8.2.180.0631.94048.06
8.2.170.0371.39936.42
8.2.160.0731.36736.55
8.2.150.0130.72736.44
8.2.140.0470.70338.12
8.2.130.0170.73038.41
8.2.120.0170.72236.92
8.2.110.0300.91436.65
8.2.100.0431.01035.35
8.2.90.0171.00036.62
8.2.80.0301.01235.00
8.2.70.0131.03635.18
8.2.60.0070.98735.58
8.2.50.0330.96434.89
8.2.40.0171.00238.07
8.2.30.0200.98836.85
8.2.20.0101.01135.42
8.2.10.0030.98735.73
8.2.00.0200.97335.69
8.1.280.0671.93847.80
8.1.270.0330.73939.81
8.1.260.0170.73437.85
8.1.250.0170.72639.74
8.1.240.0270.89037.36
8.1.230.0301.00035.10
8.1.220.0131.02535.15
8.1.210.0270.98334.64
8.1.200.0230.98634.71
8.1.190.0270.98834.64
8.1.180.0100.99234.75
8.1.170.0130.97636.07
8.1.160.0170.98536.59
8.1.150.0370.95036.23
8.1.140.0200.98036.95
8.1.130.0200.99535.13
8.1.120.0101.03034.81
8.1.110.0131.00534.92
8.1.100.0071.01034.92
8.1.90.0171.00934.91
8.1.80.0170.98634.97
8.1.70.0170.99134.98
8.1.60.0101.06935.09
8.1.50.0101.05834.98
8.1.40.0201.06535.02
8.1.30.0201.07735.09
8.1.20.0071.08635.11
8.1.10.0201.98448.95
8.1.00.0301.97448.78
8.0.300.0331.96748.13
8.0.290.0331.97247.85
8.0.280.0271.97949.86
8.0.270.0231.97948.09
8.0.260.0331.96848.51
8.0.250.0271.97748.41
8.0.240.0331.97348.26
8.0.230.0371.96748.19
8.0.220.0271.97648.23
8.0.210.0171.98848.04
8.0.200.0331.97348.29
8.0.190.0301.97548.26
8.0.180.0271.97848.23
8.0.170.0631.94348.25
8.0.160.0201.98548.33
8.0.150.0301.97548.20
8.0.140.0691.92848.04
8.0.130.0231.98144.66
8.0.120.0301.97648.20
8.0.110.0331.97148.16
8.0.100.0171.98848.21
8.0.90.0371.96848.20
8.0.80.0491.95432.23
8.0.70.0701.92748.18
8.0.60.0201.98448.17
8.0.50.0301.97548.13
8.0.30.0701.92948.39
8.0.20.0711.93248.41
8.0.10.0331.97348.16
8.0.00.0401.96248.02
7.4.330.0271.97646.64
7.4.320.0201.98547.70
7.4.300.0271.97647.75
7.4.290.0501.95147.87
7.4.280.0201.98647.77
7.4.270.0171.98547.93
7.4.260.0401.96047.81
7.4.250.0401.96547.63
7.4.240.0301.97447.73
7.4.230.0501.94947.79
7.4.220.0471.94331.61
7.4.210.0461.95839.31
7.4.200.0271.97847.79
7.4.160.0701.92733.66
7.4.150.1221.88847.90
7.4.140.0661.93947.91
7.4.130.0681.93047.90
7.4.120.0841.92147.80
7.4.110.0892.37847.75
7.4.100.0822.25247.99
7.4.90.0551.79131.59
7.4.80.0882.18247.77
7.4.70.1112.32947.87
7.4.60.0622.41047.65
7.4.50.0492.42347.81
7.4.40.0532.41047.89
7.4.30.0622.39547.88
7.4.00.0302.47046.05
7.3.330.0271.97644.77
7.3.320.0201.98444.92
7.3.310.0301.97347.71
7.3.300.0201.98647.62
7.3.290.0371.96647.57
7.3.280.0481.94732.16
7.3.270.0921.91747.62
7.3.260.0631.94147.84
7.3.250.0751.90937.63
7.3.240.0881.90747.65
7.3.230.0892.37147.76
7.3.210.0982.25747.85
7.3.200.0782.32947.62
7.3.190.0752.35447.89
7.3.180.0962.36247.81
7.3.170.0622.38847.95
7.3.160.0762.39647.80
7.2.330.1202.25947.83
7.2.320.0822.39747.93
7.2.310.0652.39947.84
7.2.300.0562.39747.99
7.2.290.0952.35247.77
7.2.60.0702.34748.73
7.2.00.0202.48149.45
7.1.200.0892.39945.59
7.1.100.2921.92247.88
7.1.70.0572.44547.07
7.1.60.0232.47948.06
7.1.50.0232.47948.15
7.1.00.0132.48752.35
7.0.200.1402.35746.30
7.0.70.1601.63735.52
7.0.60.2272.15735.40
7.0.50.0672.36351.70
7.0.40.0932.37051.82
7.0.30.1072.24051.65
7.0.20.0972.22351.70
7.0.10.0902.27051.76
7.0.00.0802.38051.77
5.6.280.0132.48737.82
5.6.220.0571.86330.48
5.6.210.0902.28329.66
5.6.200.0672.36334.13
5.6.190.0432.38335.23
5.6.180.0402.43735.16
5.6.170.0732.33034.14
5.6.160.0402.27332.14
5.6.150.0432.29033.32
5.6.140.0372.14733.57
5.6.130.0332.31731.50
5.6.120.0632.08732.40
5.6.110.0502.26033.16
5.6.100.0502.34332.97
5.6.90.0532.27732.38
5.6.80.0372.32033.88
5.6.70.0272.33332.99
5.6.60.0532.24732.15
5.6.50.0371.53728.70
5.6.40.0271.45327.34
5.6.30.0501.63728.27
5.6.20.0371.13326.44
5.6.10.0271.14026.51
5.6.00.0531.12725.00
5.5.360.0701.53327.94
5.5.350.0702.30729.18
5.5.340.1132.34333.32
5.5.330.0572.36733.68
5.5.320.0332.41733.80
5.5.310.0502.36734.04
5.5.300.0332.27732.37
5.5.290.0472.14330.42
5.5.280.0472.28033.64
5.5.270.0732.31333.26
5.5.260.0432.31732.97
5.5.250.0602.33033.52
5.5.240.0832.24031.86
5.5.230.0372.32031.92
5.5.220.0471.73328.24
5.5.210.0401.67329.46
5.5.200.0431.41727.41
5.5.190.0501.62728.55
5.5.180.0601.40326.98
5.5.160.0301.17725.57
5.5.150.0431.17326.60
5.5.140.0371.16325.70
5.5.130.0471.07325.50
5.5.120.0501.08325.70
5.5.110.0371.16326.34
5.5.100.0231.11025.65
5.5.90.0200.93325.62
5.5.80.0371.01025.79
5.5.70.0430.88724.63
5.5.60.0530.83723.93
5.5.50.0470.75723.84
5.5.40.0670.67723.58
5.5.30.0470.74024.15
5.5.20.0370.83324.78
5.5.10.0430.78023.89
5.5.00.0300.67723.73

preferences:
58.95 ms | 401 KiB | 5 Q