3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test_native() { $st = hrtime(true); $h = hash_pbkdf2('sha256', 'password', 'salt', 100000); $et = hrtime(true); return [$h, $et - $st]; } function test_emulated() { $st = hrtime(true); $K = str_pad('password', 64, "\0"); $K ^= str_repeat("\x36", 64); $ictx = hash_init('sha256'); hash_update($ictx, $K); $K ^= str_repeat("\x6a", 64); $octx = hash_init('sha256'); hash_update($octx, $K); $DK = str_repeat("\0", 32); $prev = "salt\0\0\0\1"; for ($j = 0; $j < 100000; ++$j) { $ctx = hash_copy($ictx); hash_update($ctx, $prev); $temp = hash_final($ctx, true); $ctx = hash_copy($octx); hash_update($ctx, $temp); $prev = hash_final($ctx, true); $DK ^= $prev; } $h = bin2hex($DK); $et = hrtime(true); return [$h, $et - $st]; } $nr = test_native(); $er = test_emulated(); var_dump($nr[0]); var_dump($er[0]); var_dump($nr[1] <= $er[1]);

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.5.10.0110.09820.16
8.5.00.0090.10622.00
8.4.150.0030.00014.05
8.4.140.0110.12817.70
8.4.130.0090.08818.07
8.4.120.0140.08320.70
8.4.110.0050.06122.50
8.4.100.0100.07117.95
8.4.90.0120.06717.89
8.4.80.0110.06619.73
8.4.70.0110.06917.85
8.4.60.0120.07718.97
8.4.50.0110.07918.03
8.4.40.0100.08519.44
8.4.30.0160.07918.61
8.4.20.0140.06818.16
8.4.10.0070.07522.07
8.3.280.0100.21318.46
8.3.270.0110.25816.80
8.3.260.0110.20816.91
8.3.250.0100.22319.07
8.3.240.0110.20916.82
8.3.230.0130.20716.83
8.3.220.0090.21719.00
8.3.210.0080.21616.66
8.3.200.0040.20618.50
8.3.190.0110.21717.11
8.3.180.0080.24016.84
8.3.170.0130.21717.11
8.3.160.0100.25918.54
8.3.150.0130.22616.68
8.3.140.0100.23919.23
8.3.130.0070.20816.91
8.3.120.0030.21120.72
8.3.110.0130.21316.78
8.3.100.0070.21916.51
8.3.90.0100.23926.77
8.3.80.0000.25218.43
8.3.70.0130.37816.75
8.3.60.0130.37116.75
8.3.50.0170.38020.44
8.3.40.0130.37620.34
8.3.30.0070.39118.70
8.3.20.0070.20024.18
8.3.10.0030.21624.66
8.3.00.0030.20226.16
8.2.290.0080.21020.48
8.2.280.0040.21218.61
8.2.270.0100.22519.10
8.2.260.0130.22516.57
8.2.250.0100.22216.79
8.2.240.0030.21117.53
8.2.230.0100.19820.94
8.2.220.0030.20524.06
8.2.210.0030.22626.77
8.2.200.0100.24018.66
8.2.190.0130.37218.41
8.2.180.0130.38425.92
8.2.170.0000.40319.04
8.2.160.0130.37622.96
8.2.150.0030.20925.66
8.2.140.0030.20224.66
8.2.130.0070.20126.16
8.2.120.0030.20326.16
8.2.110.0030.24822.13
8.2.100.0030.31620.70
8.1.330.0100.22018.21
8.1.320.0130.22216.28
8.1.310.0070.23318.50
8.1.300.0070.25116.35
8.1.290.0030.25330.84
8.1.280.0070.38825.92
8.1.270.0030.20424.66
8.1.260.0030.20326.35
8.1.250.0070.20028.09
8.1.240.0070.23518.70
8.1.230.0100.23718.67
8.1.100.0050.26617.46

preferences:
36.54 ms | 403 KiB | 5 Q