3v4l.org

run code in 300+ PHP versions simultaneously
<?php function hmac_compare(string $a, string $b): bool { $random = random_bytes(32); return hash_hmac('sha256', $a, $random) === hash_hmac('sha256', $b, $random); } $key = random_bytes(32); $x = hash_hmac('sha256', 'test', $key); $y = hash_hmac('sha256', 'test', $key); $z = hash_hmac('sha256', 'test2', $key); var_dump( hmac_compare($x, $y), // true hmac_compare($y, $z) );

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.2.50.0030.00719.52
8.2.40.0050.00519.52
8.2.30.0070.00719.52
8.2.20.0080.00819.52
8.2.10.0100.00319.52
8.2.00.0050.01019.52
8.1.180.0080.00519.52
8.1.170.0100.00319.52
8.1.160.0000.01519.52
8.1.150.0070.00719.52
8.1.140.0070.00719.52
8.1.130.0050.00919.52
8.1.120.0050.00919.52
8.1.110.0070.00519.52
8.1.100.0040.01119.52
8.1.90.0080.00819.52
8.1.80.0100.00519.52
8.1.70.0070.00519.52
8.1.60.0150.00019.52
8.1.50.0140.00319.52
8.1.40.0000.01619.52
8.1.30.0000.01319.52
8.1.20.0140.00019.52
8.1.10.0100.00519.52
8.1.00.0080.00619.52
8.0.280.0090.00319.52
8.0.270.0100.00519.52
8.0.260.0140.00019.52
8.0.250.0110.00319.52
8.0.240.0090.00419.52
8.0.230.0040.00819.52
8.0.220.0110.00419.52
8.0.210.0130.00319.52
8.0.200.0040.00819.52
8.0.190.0130.00019.52
8.0.180.0140.00019.52
8.0.170.0080.00819.52
8.0.160.0080.00619.52
8.0.150.0170.00019.52
8.0.140.0060.00719.52
8.0.130.0030.00919.52
8.0.120.0050.00919.52
8.0.110.0140.00019.52
8.0.100.0110.00419.52
8.0.90.0110.00419.52
8.0.80.0090.00319.52
8.0.70.0090.00619.52
8.0.60.0140.00019.52
8.0.50.0100.00319.52
8.0.30.0090.00619.52
8.0.20.0070.00819.52
8.0.10.0100.00718.25
8.0.00.0120.00718.44
7.4.330.0140.00019.52
7.4.320.0170.00019.52
7.4.300.0160.00019.52
7.4.290.0110.00719.52
7.4.280.0120.00419.52
7.4.270.0110.00519.52
7.4.260.0130.00419.52
7.4.250.0000.01619.52
7.4.240.0120.00419.52
7.4.230.0080.00819.52
7.4.220.0110.00619.52
7.4.210.0130.00219.52
7.4.200.0090.00619.52
7.4.190.0120.00319.52
7.4.180.0130.00319.52
7.4.160.0170.00019.52
7.4.150.0140.00319.52
7.4.140.0080.00917.98
7.4.130.0140.00417.93
7.4.120.0130.00718.02
7.4.110.0090.01117.96
7.4.100.0200.00117.92
7.4.90.0090.00818.09
7.4.80.0090.00918.40
7.4.70.0120.00718.49
7.4.60.0100.00818.50
7.4.50.0130.00518.46
7.4.40.0140.00518.43
7.4.30.0090.01018.49
7.4.20.0130.00718.52
7.4.10.0120.00618.51
7.4.00.0100.00718.51
7.3.330.0130.00319.52
7.3.320.0150.00019.52
7.3.310.0090.00619.52
7.3.300.0110.00419.52
7.3.290.0150.00019.52
7.3.280.0060.01019.52
7.3.270.0080.00819.52
7.3.260.0120.00518.01
7.3.250.0170.00317.96
7.3.240.0060.01317.89
7.3.230.0150.00717.90
7.3.220.0160.00318.00
7.3.210.0090.01218.00
7.3.200.0080.00918.43
7.3.190.0100.00818.47
7.3.180.0150.00518.42
7.3.170.0120.00618.44
7.3.160.0120.00718.43
7.3.150.0110.00918.45
7.3.140.0100.00818.39
7.3.130.0070.01018.49
7.3.120.0110.00918.41
7.3.110.0090.00918.49
7.3.100.0100.00918.40
7.3.90.0100.00818.43
7.3.80.0130.00718.39
7.3.70.0080.01118.45
7.3.60.0080.00918.43
7.3.50.0060.01118.42
7.3.40.0070.01018.45
7.3.30.0110.00518.42
7.3.20.0160.00318.44
7.3.10.0130.00618.47
7.3.00.0100.00818.40
7.2.340.0190.00418.06
7.2.330.0200.00317.99
7.2.320.0080.01018.52
7.2.310.0140.00518.54
7.2.300.0120.00718.51
7.2.290.0140.00618.50
7.2.280.0140.00618.49
7.2.270.0080.01318.47
7.2.260.0130.00918.44
7.2.250.0100.00818.48
7.2.240.0150.00718.42
7.2.230.0120.00818.48
7.2.220.0120.00818.44
7.2.210.0090.01218.44
7.2.200.0030.01518.47
7.2.190.0100.01018.40
7.2.180.0120.00718.44
7.2.170.0160.00418.37
7.2.160.0110.00718.40
7.2.150.0140.01118.45
7.2.140.0120.00818.37
7.2.130.0140.00418.36
7.2.120.0120.00918.42
7.2.110.0100.01218.36
7.2.100.0170.00518.42
7.2.90.0150.00618.29
7.2.80.0100.01018.40
7.2.70.0160.00718.42
7.2.60.0110.00918.35
7.2.50.0220.00518.31
7.2.40.0150.00818.46
7.2.30.0130.00718.34
7.2.20.0110.00818.52
7.2.10.0110.00918.48
7.2.00.0090.00918.52

preferences:
14.76 ms | 403 KiB | 5 Q