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(9, 15); 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.2.00.0002.50119.31
7.1.70.0502.45117.26
7.1.60.0032.49819.70
7.1.50.0072.40417.00
7.1.00.0002.50022.19
7.0.200.0072.49416.72
7.0.140.0132.48721.97
7.0.60.0102.49019.96
7.0.50.0002.50017.81
7.0.40.0072.49319.85
7.0.30.0302.47020.00
7.0.20.0232.47719.98
7.0.10.0202.48019.88
7.0.00.0132.48719.71
5.6.280.0002.50021.13
5.6.210.0172.48320.71
5.6.200.0172.48318.17
5.6.190.0102.49020.36
5.6.180.0172.48320.21
5.6.170.0372.46320.32
5.6.160.0102.49020.45
5.6.150.0102.49018.14
5.6.140.0032.49718.18
5.6.130.0032.49718.13
5.6.120.0002.50021.13
5.6.110.0072.49321.14
5.6.100.0072.49320.89
5.6.90.0172.48321.00
5.6.80.0102.49020.29
5.6.70.4132.08720.40
5.5.350.0002.50020.49
5.5.340.0072.49317.80
5.5.330.0132.48720.19
5.5.320.0372.46320.21
5.5.310.0272.47320.18
5.5.300.0032.49718.03
5.5.290.0102.49017.89
5.5.280.0032.49720.73
5.5.270.0072.49320.79
5.5.260.0072.49320.79
5.5.250.0102.49020.78
5.5.240.0032.49720.04
5.4.450.0332.46319.39
5.4.440.3672.13019.36
5.4.430.0102.48719.33
5.4.420.0172.48019.11
5.4.410.0202.47719.13
5.4.400.0132.48319.04
5.4.390.1832.31318.79
5.4.380.0272.47319.06
5.4.370.0332.46318.79
5.4.360.0232.47318.80
5.4.350.0302.46719.04
5.4.340.0272.47018.93
5.4.320.0172.48318.89
5.4.310.0572.44019.02
5.4.300.0081.98912.51
5.4.290.0141.98412.50
5.4.280.0091.98712.40
5.4.270.0171.98912.40
5.4.260.0201.98612.39
5.4.250.0211.98712.40
5.4.240.0351.98512.39
5.4.230.0302.12812.38
5.4.220.0162.13812.38
5.4.210.0482.15412.38
5.4.200.0402.09712.38
5.4.190.0342.13012.38
5.4.180.0242.36212.38
5.4.170.0292.35712.39
5.4.160.0342.33412.38
5.4.150.0252.33512.38
5.4.140.2082.09314.16
5.4.130.0242.30114.24
5.4.120.0242.34514.16
5.4.110.1982.13114.13
5.4.100.0352.30114.21
5.4.90.0202.21914.24
5.4.80.0192.16514.20
5.4.70.0152.32014.12
5.4.60.0122.36214.20
5.4.50.0102.39014.23
5.4.40.0112.36314.22
5.4.30.0202.35414.11
5.4.20.0222.35214.10
5.4.10.1732.20014.11
5.4.00.1872.18613.62
5.3.290.3202.17715.82
5.3.280.1692.20414.27
5.3.270.1892.18514.28
5.3.260.2282.11713.62
5.3.250.1262.24813.69
5.3.240.0252.34913.63
5.3.230.0242.34913.52
5.3.220.1622.21113.54
5.3.210.0162.35713.53
5.3.200.0292.31513.59
5.3.190.0322.29213.53
5.3.180.0322.19913.50
5.3.170.0182.26413.53
5.3.160.0342.07513.65
5.3.150.0362.18413.54
5.3.140.0402.31313.53
5.3.130.0442.31113.49
5.3.120.0372.35413.56
5.3.110.0342.26513.49
5.3.100.1742.07113.00
5.3.90.0382.28412.99
5.3.80.0382.29212.94
5.3.70.0242.37712.90
5.3.60.0330.07613.06
5.3.50.0240.05013.07

preferences:
34.37 ms | 400 KiB | 5 Q