3v4l.org

run code in 300+ PHP versions simultaneously
<?php // generate random string given length function genString($length = 22){ $s = ''; $chars = array_merge(range('A','Z'), range('a','z'), range(0,9)); while($length > 0){ $randKey = array_rand($chars, 1); $s .= $chars[$randKey]; $length--; } return $s; } $prefix = (PHP_VERSION_ID >= 50307) ? '$2y$' : '$2a$'; $salt = $prefix.genString(); //echo 'Salt: '.$salt.'<br>'; $password = 'password'; $hash = crypt($password, $salt); echo 'Strlen: '.strlen($hash).' ------ '; if (crypt($password, $hash) == $hash) { echo "Password verified!"; }

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.3.10.0050.00816.62
7.3.00.0010.00716.52
7.2.130.0060.01016.62
7.2.120.0070.01116.76
7.2.110.0060.00916.96
7.2.100.0090.00516.75
7.2.90.0120.00816.88
7.2.80.0060.01116.86
7.2.70.0140.00516.77
7.2.60.0020.01316.95
7.2.50.0080.00816.78
7.2.40.0100.01016.79
7.2.30.0100.00716.88
7.2.20.0080.01016.83
7.2.10.0090.00416.73
7.2.00.0050.01217.87
7.1.250.0070.00815.86
7.1.70.0050.00317.11
7.1.60.0030.00717.32
7.1.50.0100.01017.05
7.1.00.0070.03022.51
7.0.200.0000.01616.97
7.0.140.0030.07321.95
7.0.110.0200.09719.94
7.0.100.0330.05020.10
7.0.90.0330.06319.93
7.0.80.0100.08319.94
7.0.70.0100.07019.86
7.0.60.0270.05320.01
7.0.50.0230.08020.06
7.0.40.0030.05719.59
7.0.30.0030.07319.87
7.0.20.0130.07319.69
7.0.10.0070.04719.69
7.0.00.0100.06719.70
5.6.280.0070.07020.81
5.6.260.0100.07320.73
5.6.250.0000.05020.71
5.6.240.0030.05320.73
5.6.230.0000.05020.90
5.6.220.0030.08020.70
5.6.210.0030.04020.78
5.6.200.0100.07720.75
5.6.190.0130.03720.59
5.6.180.0200.06720.64
5.6.170.0030.04320.68
5.6.160.0100.06720.60
5.6.150.0100.07020.63
5.6.140.0070.08720.68
5.6.130.0230.07020.69
5.6.120.0070.07020.71
5.6.110.0100.08020.66
5.6.100.0000.05320.59
5.6.90.0130.07720.58
5.6.80.0070.04320.07
5.6.70.0030.04720.05
5.6.60.0070.04720.04
5.6.50.0070.07020.07
5.6.40.0070.08020.11
5.6.30.0030.07320.05
5.6.20.0170.04320.02
5.6.10.0100.06719.86
5.6.00.0100.03719.97
5.5.380.0070.04317.73
5.5.370.0030.07317.76
5.5.360.0100.05317.61
5.5.350.0030.04717.66
5.5.340.0100.06018.15
5.5.330.0030.07318.29
5.5.320.0100.07318.20
5.5.310.0000.05017.89
5.5.300.0030.07718.31
5.5.290.0100.07718.02
5.5.280.0070.08317.98
5.5.270.0030.05318.29
5.5.260.0070.07718.01
5.5.250.0130.06717.98
5.5.240.0130.07317.57
5.5.230.0100.06017.40
5.5.220.0030.05317.63
5.5.210.0100.05717.49
5.5.200.0000.09017.33
5.5.190.0030.05017.51
5.5.180.0030.06317.51
5.5.160.0130.07317.35
5.5.150.0030.07317.51
5.5.140.0070.04317.50
5.5.130.0070.07317.37
5.5.120.0100.07317.63
5.5.110.0130.07317.50
5.5.100.0100.03317.15
5.5.90.0070.06317.43
5.5.80.0070.08017.40
5.5.70.0100.06717.39
5.5.60.0070.06717.26
5.5.50.0030.04717.14
5.5.40.0000.04317.23
5.5.30.0100.05317.27
5.5.20.0070.06317.39
5.5.10.0030.07017.53
5.5.00.0030.07017.52
5.4.450.0100.04719.57
5.4.440.0070.06319.59
5.4.430.0070.08019.39
5.4.420.0030.04719.38
5.4.410.0030.06019.42
5.4.400.0070.08019.08
5.4.390.0070.06719.38
5.4.380.0070.05019.05
5.4.370.0100.07319.30
5.4.360.0030.07719.20
5.4.350.0030.04319.15
5.4.340.0100.07019.10
5.4.320.0100.07319.23
5.4.310.0070.04319.10
5.4.300.0170.06719.07
5.4.290.0100.07319.30
5.4.280.0100.07319.20
5.4.270.0130.07319.09
5.4.260.0130.06319.15
5.4.250.0100.07019.00
5.4.240.0130.06719.15
5.4.230.0030.08019.28
5.4.220.0100.07319.14
5.4.210.0070.04019.37
5.4.200.0000.05319.20
5.4.190.0070.06019.06
5.4.180.0100.07319.07
5.4.170.0170.06719.29
5.4.160.0030.07319.18
5.4.150.0070.07319.34
5.4.140.0030.07716.41
5.4.130.0130.05716.38
5.4.120.0030.04316.59
5.4.110.0070.06016.47
5.4.100.0000.08016.59
5.4.90.0170.06016.61
5.4.80.0030.07016.60
5.4.70.0070.06016.63
5.4.60.0070.04016.59
5.4.50.0100.07016.35
5.4.40.0030.05016.51
5.4.30.0030.07716.69
5.4.20.0000.04716.46
5.4.10.0030.07716.54
5.4.00.0070.04016.08
5.3.290.0070.07314.73
5.3.280.0130.07014.76
5.3.270.0030.08314.91
5.3.260.0130.02714.77
5.3.250.0130.06714.90
5.3.240.0070.06714.70
5.3.230.0070.07714.76
5.3.220.0100.06014.51
5.3.210.0030.07314.64
5.3.200.0070.07314.64
5.3.190.0130.07014.78
5.3.180.0070.07014.49
5.3.170.0070.07014.77
5.3.160.0100.05314.71
5.3.150.0030.05314.72
5.3.140.0070.07014.75
5.3.130.0030.08714.58
5.3.120.0030.07014.64
5.3.110.0030.07314.75
5.3.100.0100.06014.24
5.3.90.0100.06013.95
5.3.80.0070.04014.08
5.3.70.0030.06014.17
5.3.60.0030.07714.12
5.3.50.0030.07713.98
5.3.40.0030.07313.98
5.3.30.0070.07313.84
5.3.20.0170.03313.73
5.3.10.0100.03713.58
5.3.00.0030.07013.70
5.2.170.0030.05711.23
5.2.160.0030.03311.16
5.2.150.0070.06011.16
5.2.140.0030.05711.13
5.2.130.0030.06011.09
5.2.120.0070.06011.27
5.2.110.0070.02711.35
5.2.100.0030.03311.11
5.2.90.0100.06011.10
5.2.80.0100.04711.07
5.2.70.0030.05710.96
5.2.60.0130.05011.03
5.2.50.0070.06011.00
5.2.40.0030.05710.85
5.2.30.0070.06011.07
5.2.20.0070.03010.97
5.2.10.0130.02711.11
5.2.00.0030.03010.82
5.1.60.0030.04710.19
5.1.50.0100.05010.19
5.1.40.0070.04710.19
5.1.30.0100.05010.31
5.1.20.0070.05310.37
5.1.10.0070.05310.19
5.1.00.0070.02710.26
5.0.50.0030.04710.19
5.0.40.0000.04010.19
5.0.30.0000.03310.19
5.0.20.0070.03710.19
5.0.10.0000.02010.19
5.0.00.0000.03310.19
4.4.90.0000.03710.19
4.4.80.0030.03310.19
4.4.70.0000.02010.19
4.4.60.0070.03010.19
4.4.50.0000.03710.19
4.4.40.0070.02710.19
4.4.30.0030.02710.19
4.4.20.0030.02010.19
4.4.10.0000.02710.19
4.4.00.0000.05710.19
4.3.110.0070.01310.19
4.3.100.0030.03010.19
4.3.90.0000.01710.19
4.3.80.0030.04310.19
4.3.70.0000.02310.19
4.3.60.0030.03310.19
4.3.50.0030.02310.19
4.3.40.0000.02710.19
4.3.30.0030.03310.19
4.3.20.0000.02010.19
4.3.10.0000.01710.19
4.3.00.0030.01310.19

preferences:
33.28 ms | 401 KiB | 5 Q