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.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.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.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:
44.04 ms | 401 KiB | 5 Q