3v4l.org

run code in 300+ PHP versions simultaneously
<?php function bcryptWithCost($cost) { $cost = str_pad($cost, 2, '0', STR_PAD_LEFT); crypt('password', '$2y$' . $cost . '$thisisasaltthisisasalt'); } $costs = range(12, 13); foreach ($costs as $cost) { $timestamp = microtime(true); bcryptWithCost($cost); $time = microtime(true) - $timestamp; echo $cost . ' ' . $time . PHP_EOL; if (!isset($recommended) && $time >= 0.5) { $recommended = $cost; } if (isset($recommended) && $time < 0.9) { $recommended = $cost; } } echo "recommended cost param for this environment: $recommended\n";

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.4.00.0070.74114.70
7.3.120.0030.76714.76
7.3.110.0030.76414.63
7.3.100.0130.74514.92
7.3.90.0100.73814.96
7.3.80.0070.74314.76
7.3.70.0030.74514.60
7.3.60.0130.74014.70
7.3.50.0070.73814.97
7.3.40.0030.74614.86
7.3.30.0000.73514.77
7.3.20.0000.75116.74
7.3.10.0030.74116.67
7.3.00.0050.74216.69
7.2.250.0030.76315.20
7.2.240.0130.75915.08
7.2.230.0070.75614.86
7.2.220.0000.75815.25
7.2.210.0030.73815.16
7.2.200.0030.74015.03
7.2.190.0030.75214.98
7.2.180.0070.74814.74
7.2.170.0100.73315.12
7.2.160.0070.74614.98
7.2.150.0000.73616.82
7.2.140.0030.73616.82
7.2.130.0080.73516.80
7.2.120.0050.73317.08
7.2.110.0100.72916.92
7.2.100.0070.73316.76
7.2.90.0030.74216.96
7.2.80.0070.72916.80
7.2.70.0070.71817.08
7.2.60.0030.73217.06
7.2.50.0120.73416.82
7.2.40.0050.74316.77
7.2.30.0100.72717.04
7.2.20.0070.72916.88
7.2.10.0020.74216.99
7.2.00.0030.73417.76
7.1.330.0100.76015.78
7.1.320.0000.75815.41
7.1.310.0030.74615.59
7.1.300.0070.72815.59
7.1.290.0100.72415.85
7.1.280.0000.74115.83
7.1.270.0070.73616.00
7.1.260.0000.74515.71
7.1.250.0030.72715.67
7.1.240.0100.73715.81
7.1.230.0070.73615.83
7.1.220.0030.72615.87
7.1.210.0070.74015.80
7.1.200.0030.73515.65
7.1.190.0070.72915.91
7.1.180.0000.74415.39
7.1.170.0070.74815.94
7.1.160.0000.75115.74
7.1.150.0030.74815.69
7.1.140.0030.72215.86
7.1.130.0000.73315.86
7.1.120.0100.73115.88
7.1.110.0030.75015.82
7.1.100.0000.71215.84
7.1.90.0030.75115.82
7.1.80.0030.74015.98
7.1.70.0070.73716.56
7.1.60.0020.77817.44
7.1.50.0070.74525.20
7.1.40.0000.74015.71
7.1.30.0000.73915.79
7.1.20.0000.74615.50
7.1.10.0070.72615.75
7.1.00.0050.73819.00
7.0.330.0030.73515.11
7.0.320.0000.74215.43
7.0.310.0070.73715.34
7.0.300.0070.72015.29
7.0.290.0170.73415.18
7.0.280.0390.69915.35
7.0.270.0030.71315.24
7.0.260.0000.75215.38
7.0.250.0030.73415.18
7.0.240.0070.74015.47
7.0.230.0030.74315.61
7.0.220.0000.72015.54
7.0.210.0030.74115.25
7.0.200.0050.71916.21
7.0.190.0030.72915.43
7.0.180.0130.73615.28
7.0.170.0030.73115.52
7.0.160.0030.73815.32
7.0.150.0100.74815.24
7.0.140.0070.73718.85
7.0.130.0070.74615.30
7.0.120.0070.74615.42
7.0.110.0030.73515.51
7.0.100.0070.70817.76
7.0.90.0100.80517.66
7.0.80.0100.77717.63
7.0.70.0050.70317.56
7.0.60.0070.69517.58
7.0.50.0130.78717.86
7.0.40.0080.78016.54
7.0.30.0080.77016.83
7.0.20.0030.77316.76
7.0.10.0080.78716.73
7.0.00.0030.75816.76
5.6.400.0000.74614.20
5.6.390.0100.73814.08
5.6.380.0030.74414.16
5.6.370.0030.73014.09
5.6.360.0070.72714.06
5.6.350.0070.75313.93
5.6.340.0070.74914.35
5.6.330.0030.74114.57
5.6.320.0100.74114.34
5.6.310.0030.74714.11
5.6.300.0030.71814.18
5.6.290.0030.74914.41
5.6.280.0050.75617.54
5.6.270.0030.75214.51
5.6.260.0070.74014.26
5.6.250.0130.73717.47
5.6.240.0000.69617.48
5.6.230.0080.78917.40
5.6.220.0080.78517.33
5.6.210.0080.76717.43
5.6.200.0070.70617.72
5.6.190.0050.78017.63
5.6.180.0050.80317.46
5.6.170.0080.80017.47
5.6.160.0080.77917.57
5.6.150.0050.79217.66
5.6.140.0050.75517.56
5.6.130.0120.76917.58
5.6.120.0030.69917.69
5.6.110.0150.75817.51
5.6.100.0070.74917.54
5.6.90.0070.78517.72
5.6.80.0050.78717.36
5.6.70.0050.77017.26
5.6.60.0050.71717.33
5.6.50.0070.72817.16
5.6.40.0020.76117.27
5.6.30.0100.77517.16
5.6.20.0050.77217.34
5.6.10.0070.77117.12
5.6.00.0100.77417.25
5.5.380.0070.76217.26
5.5.370.0100.77417.27
5.5.360.0080.79017.07
5.5.350.0030.78617.17
5.5.340.0080.79117.37
5.5.330.0070.79217.29
5.5.320.0080.77717.45
5.5.310.0080.77317.46
5.5.300.0080.81517.36
5.5.290.0050.78817.63
5.5.280.0050.78117.49
5.5.270.0100.79517.31
5.5.260.0030.77417.37
5.5.250.0080.77417.25
5.5.240.0050.79317.17
5.5.230.0030.69516.94
5.5.220.0000.70017.04
5.5.210.0050.71917.22
5.5.200.0050.79817.27
5.5.190.0080.78217.12
5.5.180.0050.78117.03
5.5.170.0030.71714.12
5.5.160.0080.78117.01
5.5.150.0100.76416.96
5.5.140.0070.73317.00
5.5.130.0080.76517.07
5.5.120.0020.79217.00
5.5.110.0070.72217.12
5.5.100.0020.69516.93
5.5.90.0050.77917.08
5.5.80.0030.69317.04
5.5.70.0100.77316.99
5.5.60.0070.77716.84
5.5.50.0030.78017.02
5.5.40.0120.78817.05
5.5.30.0070.71717.04
5.5.20.0080.77417.08
5.5.10.0080.77416.85
5.5.00.0020.78217.08
5.4.450.0030.70515.34
5.4.440.0050.78215.23
5.4.430.0070.77615.33
5.4.420.0080.77915.28
5.4.410.0050.69814.98
5.4.400.0090.80514.81
5.4.390.0050.72115.04
5.4.380.0050.68015.04
5.4.370.0070.69814.69
5.4.360.0020.70814.94
5.4.350.0050.78114.74
5.4.340.0050.74715.10
5.4.330.0000.74511.14
5.4.320.0050.76914.89
5.4.310.0030.69915.06
5.4.300.0030.77115.02
5.4.290.0080.69514.98
5.4.280.0050.70515.01
5.4.270.0020.79214.94
5.4.260.0070.78014.88
5.4.250.0070.77315.02
5.4.240.0080.76914.77
5.4.230.0070.70814.97
5.4.220.0020.78414.87
5.4.210.0070.80314.94
5.4.200.0100.78114.79
5.4.190.0030.79515.10
5.4.180.0020.77415.12
5.4.170.0020.72915.12
5.4.160.0080.79615.05
5.4.150.0050.77515.06
5.4.140.0020.69913.74
5.4.130.0030.73813.66
5.4.120.0080.77513.51
5.4.110.0030.79313.57
5.4.100.0070.79813.45
5.4.90.0020.73213.56
5.4.80.0030.78013.74
5.4.70.0030.69313.68
5.4.60.0050.69113.53
5.4.50.0080.75613.72
5.4.40.0050.76113.63
5.4.30.0030.70713.79
5.4.20.0020.78413.62
5.4.10.0100.78413.54
5.4.00.0050.72913.20
5.3.290.0050.75912.71
5.3.280.0050.79312.63
5.3.270.0070.78312.54
5.3.260.0030.76112.63
5.3.250.0050.70112.68
5.3.240.0070.79012.49
5.3.230.0050.78012.53
5.3.220.0080.76312.55
5.3.210.0070.78112.64
5.3.200.0400.75512.54
5.3.190.0050.71012.57
5.3.180.0000.70212.71
5.3.170.0050.69912.61
5.3.160.0020.68812.48
5.3.150.0370.68512.55
5.3.140.0000.78912.45
5.3.130.0020.73312.56
5.3.120.0030.75612.58
5.3.110.0030.68112.55
5.3.100.0070.74712.33
5.3.90.0030.69212.38
5.3.80.0050.72712.25
5.3.70.0020.78412.28
5.3.60.0030.03712.42
5.3.50.0050.04012.44
5.3.40.0030.04212.40
5.3.30.0040.02412.45
5.3.20.0020.03212.24
5.3.10.0050.02211.99
5.3.00.0060.02911.98
5.2.170.0070.03713.59
5.2.160.0130.05013.59
5.2.150.0070.03313.59
5.2.140.0070.03713.59
5.2.130.0100.04713.59
5.2.120.0070.05713.59
5.2.110.0000.03313.59
5.2.100.0000.06313.59
5.2.90.0000.06313.59
5.2.80.0030.06313.59
5.2.70.0100.04313.59
5.2.60.0070.04313.59
5.2.50.0030.03713.59
5.2.40.0030.03013.59
5.2.30.0070.06313.59
5.2.20.0070.06713.59
5.2.10.0000.04313.59
5.2.00.0000.03313.59
5.1.60.0000.04713.59
5.1.50.0030.02313.59
5.1.40.0070.05313.59
5.1.30.0000.03313.59
5.1.20.0100.04713.59
5.1.10.0000.03013.59
5.1.00.0030.03313.59
5.0.50.0070.02713.59
5.0.40.0000.02313.59
5.0.30.0070.05313.59
5.0.20.0030.03013.59
5.0.10.0030.03713.59
5.0.00.0030.03313.59
4.4.90.0000.02713.59
4.4.80.0000.02013.59
4.4.70.0030.02313.59
4.4.60.0070.02713.59
4.4.50.0070.01313.59
4.4.40.0000.02713.59
4.4.30.0000.02313.59
4.4.20.0100.01313.59
4.4.10.0100.01713.59
4.4.00.0030.02313.59
4.3.110.0000.02313.59
4.3.100.0030.01713.59
4.3.90.0000.02013.59
4.3.80.0070.04713.59
4.3.70.0000.02013.59
4.3.60.0000.03313.59
4.3.50.0000.02013.59
4.3.40.0070.05013.59
4.3.30.0000.04013.59
4.3.20.0000.02713.59
4.3.10.0030.03313.59
4.3.00.0030.03713.59

preferences:
41.07 ms | 400 KiB | 5 Q