3v4l.org

run code in 300+ PHP versions simultaneously
<?php $salt = substr(str_replace('+', '.', base64_encode(sha1(microtime(true), true))), 0, 22); // 2a is the bcrypt algorithm selector, see http://php.net/crypt // 12 is the workload factor (around 300ms on my Core i7 machine), see http://php.net/crypt echo $hash = crypt('falcon', '$2a$12$' . $salt); var_dump('$2a$12$' . $salt); // we can now use the generated hash as the argument to crypt(), since it too will contain $a2$12$... with a variation of the hash. No need to store the salt anymore, just the hash is enough! var_dump($hash == crypt('foo', $hash)); // true var_dump($hash == crypt('falcon', $hash)); // false

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)
7.2.00.0070.73819.45
7.1.70.0000.73017.15
7.1.60.0030.80119.82
7.1.50.0030.78116.93
7.1.00.0030.70022.28
7.0.200.0030.72916.78
7.0.140.0130.75322.09
7.0.60.0030.79020.05
7.0.50.0030.80717.84
7.0.40.0130.81320.40
7.0.30.0370.81020.05
7.0.20.0300.79320.09
7.0.10.0230.81320.16
7.0.00.0130.76320.09
5.6.280.0100.77320.98
5.6.210.0000.83320.59
5.6.200.0100.81318.19
5.6.190.0100.82720.56
5.6.180.3430.74020.59
5.6.170.0270.80020.45
5.6.160.0030.82320.35
5.6.150.0100.78718.20
5.6.140.0100.82318.21
5.6.130.0070.76018.20
5.6.120.0030.77721.00
5.6.110.0100.82721.01
5.6.100.0100.82321.13
5.6.90.0870.77720.99
5.6.80.0000.76720.48
5.6.70.0200.82320.34
5.5.350.0170.81020.32
5.5.340.0030.78718.02
5.5.330.0070.77320.40
5.5.320.0200.83320.18
5.5.310.0230.83320.31
5.5.300.0070.81018.02
5.5.290.0130.77017.98
5.5.280.0070.83720.73
5.5.270.0000.78020.76
5.5.260.0130.82020.95
5.5.250.0070.81020.54
5.5.240.0000.75020.25
5.4.450.0271.04719.49
5.4.440.0131.02719.47
5.4.430.0801.01719.32
5.4.420.0731.01019.58
5.4.410.0771.02319.44
5.4.400.0301.01318.76
5.4.390.0201.01718.71
5.4.380.0531.01318.79
5.4.370.0130.99718.74
5.4.360.0200.99718.66
5.4.350.0131.01718.53
5.4.340.0231.00718.63
5.4.320.0080.74712.46
5.4.310.0060.74912.45
5.4.300.0080.75112.45
5.4.290.0090.75112.45
5.4.280.0110.74312.35
5.4.270.0070.74712.35
5.4.260.0071.11018.96
5.4.250.0201.14318.98
5.4.240.0131.14018.65
5.4.230.0171.10018.79
5.4.220.0201.07318.83
5.4.210.0201.09018.97
5.4.200.0071.13018.68
5.4.190.0431.11318.91
5.4.180.0131.10018.87
5.4.170.0171.08018.98
5.4.160.0131.11718.77
5.4.150.0131.09318.85
5.4.140.0131.06316.30
5.4.130.0101.09716.26
5.4.120.0071.09016.44
5.4.110.0171.08716.40
5.4.100.0071.09016.25
5.4.90.0071.07016.32
5.4.80.0231.06016.44
5.4.70.0071.14316.38
5.4.60.0071.12016.25
5.4.50.0031.11316.30
5.4.40.0131.15716.37
5.4.30.0071.15716.35
5.4.20.0271.13716.51
5.4.10.0131.08016.30
5.4.00.0131.09315.75
5.3.290.0100.74912.80
5.3.280.0171.13314.68
5.3.270.0171.17314.44
5.3.260.0171.10714.47
5.3.250.0071.11714.63
5.3.240.0071.08714.70
5.3.230.0171.09014.64
5.3.220.0131.09714.61
5.3.210.0131.08014.58
5.3.200.0171.06014.48
5.3.190.0031.07314.43
5.3.180.0131.04714.40
5.3.170.0071.09314.58
5.3.160.0101.06714.57
5.3.150.0071.06714.43
5.3.140.0131.09714.47
5.3.130.0071.06314.70
5.3.120.0101.07714.56
5.3.110.0101.08714.43
5.3.100.0131.06713.73
5.3.90.0071.09013.71
5.3.80.0201.05314.17
5.3.70.0101.06713.86
5.3.60.0171.05714.04
5.3.50.0101.07013.79
5.3.40.0071.07713.94
5.3.30.0001.07713.94
5.3.20.0071.10013.68
5.3.10.0131.10013.70
5.3.00.0031.07713.65
5.2.170.0000.05311.09
5.2.160.0000.04711.18
5.2.150.0070.04310.98
5.2.140.0070.05011.13
5.2.130.0030.05310.95
5.2.120.0070.03711.04
5.2.110.0000.04310.92
5.2.100.0100.03310.94
5.2.90.0100.05011.06
5.2.80.0070.05310.92
5.2.70.0100.03711.08
5.2.60.0070.05311.09
5.2.50.0070.05010.94
5.2.40.0070.05010.93
5.2.30.0100.03710.91
5.2.20.0100.04710.84
5.2.10.0070.04710.93
5.2.00.0030.04010.77
5.1.60.0030.04710.09
5.1.50.0000.0409.95
5.1.40.0030.0339.91
5.1.30.0100.03010.14
5.1.20.0030.05310.39
5.1.10.0000.0439.96
5.1.00.0130.04710.26
5.0.50.0000.0308.61
5.0.40.0070.0238.36
5.0.30.0000.0478.15
5.0.20.0030.0378.36
5.0.10.0000.0308.23
5.0.00.0100.0378.24
4.4.90.0030.0237.29
4.4.80.0070.0207.29
4.4.70.0000.0337.29
4.4.60.0030.0307.29
4.4.50.0030.0237.29
4.4.40.0100.0437.29
4.4.30.0030.0207.29
4.4.20.0030.0277.29
4.4.10.0030.0307.29
4.4.00.0000.0377.29
4.3.110.0000.0307.29
4.3.100.0070.0177.29
4.3.90.0070.0207.29
4.3.80.0030.0377.29
4.3.70.0030.0307.29
4.3.60.0070.0237.29
4.3.50.0000.0237.29
4.3.40.0030.0307.29
4.3.30.0070.0177.29
4.3.20.0030.0207.29
4.3.10.0000.0237.29
4.3.00.0130.0237.90

preferences:
35.15 ms | 400 KiB | 5 Q