3v4l.org

run code in 300+ PHP versions simultaneously
<?php $password = "chemicals1"; $expected = "{SSHA512}w/lHn2LXfNletbfyLVYutBFqUjGPzhmptyleVlehUZSZdylZCt/sDmvkhTBV1Ln4f6rzXTdM6eOGr3LX7FgGCF5/fsbs0vVq"; function compare_postfix_ssha512_hash($password, $valid_hash) { $hash_algo = "{SSHA512}"; $salt_length = 8; // strip the identifier from the hash (if exists) $valid_hash = str_replace($hash_algo, "", $valid_hash); // get the salt from the valid hash $salt = substr(base64_decode($valid_hash), -$salt_length); // strip the salt from the end of the valid hash $valid_hash = base64_encode(substr(base64_decode($valid_hash), 0, -$salt_length)); // hash our password with the salt $hash = base64_encode(hash('sha512', "{$password}{$salt}", true)); // return the comparison return hash_equals($valid_hash, $hash); } var_dump(compare_postfix_ssha512_hash($password, $expected));

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.0110.00716.63
8.3.50.0090.01122.11
8.3.40.0110.00318.59
8.3.30.0120.00318.67
8.3.20.0050.00220.31
8.3.10.0070.00021.91
8.3.00.0050.00322.27
8.2.180.0070.01416.38
8.2.170.0040.01122.96
8.2.160.0080.00519.40
8.2.150.0080.00024.18
8.2.140.0050.00224.66
8.2.130.0040.00426.16
8.2.120.0080.00020.63
8.2.110.0040.00419.39
8.2.100.0040.00817.72
8.2.90.0030.00517.78
8.2.80.0030.00719.76
8.2.70.0080.00017.63
8.2.60.0080.00017.50
8.2.50.0000.00917.75
8.2.40.0000.00819.22
8.2.30.0000.00819.25
8.2.20.0020.00517.60
8.2.10.0040.00418.02
8.2.00.0030.00517.66
8.1.280.0120.00625.92
8.1.270.0080.00023.96
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00722.42
8.1.230.0060.00821.04
8.1.220.0080.00018.68
8.1.210.0000.00719.16
8.1.200.0060.00317.13
8.1.190.0000.00817.23
8.1.180.0050.00318.10
8.1.170.0040.00417.65
8.1.160.0040.00422.19
8.1.150.0000.00818.75
8.1.140.0040.00419.39
8.1.130.0050.00517.64
8.1.120.0040.00417.41
8.1.110.0080.00017.32
8.1.100.0000.00817.31
8.1.90.0030.00317.25
8.1.80.0040.00417.39
8.1.70.0030.00317.30
8.1.60.0030.00617.53
8.1.50.0000.00817.41
8.1.40.0060.00317.51
8.1.30.0000.00817.65
8.1.20.0030.00517.68
8.1.10.0000.00917.40
8.1.00.0050.00317.41
8.0.300.0040.00420.02
8.0.290.0000.00816.75
8.0.280.0030.00318.48
8.0.270.0050.00517.20
8.0.260.0000.00617.33
8.0.250.0070.00016.98
8.0.240.0040.00416.84
8.0.230.0030.00516.96
8.0.220.0060.00016.93
8.0.210.0000.00716.90
8.0.200.0000.00617.02
8.0.190.0000.00817.01
8.0.180.0040.00416.84
8.0.170.0040.00416.85
8.0.160.0050.00216.73
8.0.150.0040.00316.74
8.0.140.0030.00416.88
8.0.130.0000.00613.27
8.0.120.0080.00016.76
8.0.110.0000.00716.80
8.0.100.0040.00416.85
8.0.90.0040.00416.84
8.0.80.0140.00716.85
8.0.70.0000.00816.89
8.0.60.0070.00016.97
8.0.50.0040.00416.86
8.0.30.0090.01017.23
8.0.20.0080.01117.40
8.0.10.0070.00016.84
8.0.00.0170.00016.59
7.4.330.0000.00715.08
7.4.320.0030.00316.54
7.4.300.0030.00316.55
7.4.290.0050.00216.50
7.4.280.0030.00616.49
7.4.270.0000.00716.61
7.4.260.0000.00716.62
7.4.250.0000.00716.58
7.4.240.0040.00416.52
7.4.230.0000.00716.39
7.4.220.0100.00716.63
7.4.210.0030.01116.64
7.4.200.0070.00016.44
7.4.160.0090.00716.58
7.4.150.0140.00417.40
7.4.140.0090.01117.86
7.4.130.0070.01316.52
7.4.120.0170.00316.65
7.4.110.0150.00916.64
7.4.100.0070.01016.53
7.4.90.0110.00716.41
7.4.80.0200.00319.39
7.4.70.0100.00616.57
7.4.60.0130.00716.50
7.4.50.0070.00716.34
7.4.40.0070.01316.54
7.4.30.0140.00516.63
7.4.00.0000.01215.06
7.3.330.0050.00013.38
7.3.320.0060.00013.21
7.3.310.0000.00716.20
7.3.300.0000.00716.32
7.3.290.0040.00416.35
7.3.280.0100.00916.31
7.3.270.0130.01017.40
7.3.260.0080.01016.54
7.3.250.0130.00716.22
7.3.240.0090.01016.38
7.3.230.0100.00716.39
7.3.210.0080.00816.40
7.3.200.0090.01216.30
7.3.190.0120.00616.44
7.3.180.0090.00916.36
7.3.170.0040.01216.62
7.3.160.0090.01216.24
7.2.330.0000.01816.59
7.2.320.0070.01016.54
7.2.310.0100.00616.45
7.2.300.0090.01516.76
7.2.290.0090.01016.45
7.2.60.0000.01216.78
7.2.00.0000.01419.30
7.1.200.0000.01515.48
7.1.70.0030.01017.07
7.1.60.0040.01117.31
7.1.00.0030.07722.54
7.0.200.0290.01015.00
7.0.100.0270.06720.09
7.0.90.0130.08020.05
7.0.80.0270.07019.91
7.0.70.0270.04720.00
7.0.60.0170.05320.02
7.0.50.0100.06320.23
7.0.40.0230.05720.35
7.0.30.0200.05320.25
7.0.20.0200.05320.42
7.0.10.0200.05320.37
7.0.00.0200.05320.47
5.6.250.0230.04720.52
5.6.240.0200.05020.76
5.6.230.0030.06320.76
5.6.220.0100.06020.72
5.6.210.0230.04720.66
5.6.200.0130.05721.08
5.6.190.0030.06321.08
5.6.180.0000.06321.01
5.6.170.0100.06021.01
5.6.160.0100.05721.09
5.6.150.0100.05721.06
5.6.140.0100.05721.19
5.6.130.0130.05721.11
5.6.120.0070.06021.07
5.6.110.0130.08021.00
5.6.100.0170.05321.10
5.6.90.0200.06021.06
5.6.80.0100.06320.52
5.6.70.0100.05720.45
5.6.60.0070.05320.47
5.6.50.0100.05320.49
5.6.40.0130.05020.41
5.6.30.0200.04020.43
5.6.20.0100.05720.46
5.6.10.0070.06020.50
5.6.00.0130.05320.45

preferences:
34.9 ms | 401 KiB | 5 Q