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; } }

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.0072.49419.19
7.1.70.0002.50116.91
7.1.60.0072.49417.27
7.1.50.0172.48517.27
7.1.00.0032.49722.27
7.0.200.0072.49416.64
7.0.140.0032.49721.97
7.0.60.0072.49319.91
7.0.50.0032.49717.79
7.0.40.0072.49319.84
7.0.30.0202.48019.71
7.0.20.0272.47319.70
7.0.10.0132.48719.89
7.0.00.0072.49319.97
5.6.280.0032.49721.10
5.6.210.0072.49320.50
5.6.200.0032.49718.12
5.6.190.0072.49320.31
5.6.180.0332.46720.23
5.6.170.0202.48020.33
5.6.160.0032.49720.43
5.6.150.0032.49718.14
5.6.140.0032.49718.19
5.6.130.0102.49018.12
5.6.120.0072.49320.97
5.6.110.0072.49321.14
5.6.100.0072.49320.89
5.6.90.0072.49321.08
5.6.80.0102.49020.54
5.5.350.0232.47720.35
5.5.340.0331.88320.84
5.5.330.0202.11020.84
5.5.320.0271.96020.79
5.5.310.0101.96020.68
5.5.300.0102.49017.93
5.5.290.0302.00020.94
5.5.280.0232.41720.84
5.5.270.0102.42320.95
5.5.260.0102.49020.87
5.5.250.0072.49320.46
5.5.240.0132.48720.29
5.4.450.0071.92719.38
5.4.440.0202.26719.54
5.4.430.0202.46319.43
5.4.420.0102.44719.39
5.4.410.0102.46719.02
5.4.400.0072.43319.03
5.4.390.0172.46318.50
5.4.380.0002.46319.14
5.4.370.0572.30718.68
5.4.360.0772.37718.54
5.4.350.0172.45318.91
5.4.340.0071.99512.02
5.4.320.0102.37319.10
5.4.310.0131.98712.50
5.4.300.0342.03012.51
5.4.290.0271.98912.50
5.4.280.0132.44319.05
5.4.270.0232.39019.21
5.4.260.0232.39018.95
5.4.250.0191.99512.40
5.4.240.0311.99112.40
5.4.230.0252.10212.38
5.4.220.0162.11412.38
5.4.210.0222.11212.38
5.4.200.0142.11412.38
5.4.190.0192.34015.60
5.4.180.0282.26715.71
5.4.170.0242.30815.80
5.4.160.0202.12515.69
5.4.150.0222.06115.60
5.4.140.0202.10712.06
5.4.130.0302.09512.05
5.4.120.0142.11212.01
5.4.110.0242.11414.27
5.4.100.0172.21514.16
5.4.90.0152.33514.20
5.4.80.0152.34714.23
5.4.70.0242.31314.27
5.4.60.0242.20814.25
5.4.50.0271.98312.00
5.4.40.0321.85811.99
5.4.30.0301.96011.99
5.4.20.0261.77814.10
5.4.10.0291.74414.21
5.4.00.0312.04311.47
5.3.290.0051.99712.80
5.3.280.0262.10412.71
5.3.270.0252.33713.57
5.3.260.0182.28213.60
5.3.250.0182.08512.72
5.3.240.0272.10313.61
5.3.230.0252.05812.71
5.3.220.0252.01013.55
5.3.210.0262.07212.68
5.3.200.0232.11612.68
5.3.190.0262.08912.68
5.3.180.0312.08012.67
5.3.170.0272.08912.67
5.3.160.0212.11812.67
5.3.150.0362.33713.56
5.3.140.0242.07212.66
5.3.130.0242.23813.49
5.3.120.0322.29013.51
5.3.110.0272.28713.54
5.3.100.0372.27512.94
5.3.90.0222.06212.08
5.3.80.0392.36212.92
5.3.70.0452.01312.07
5.3.60.0120.04512.13
5.3.50.0200.06712.08
5.3.40.0120.04812.08
5.3.30.0200.06912.04
5.3.20.0200.07111.82
5.3.10.0140.04511.79
5.3.00.0180.07011.77
5.2.170.0230.0569.35
5.2.160.0250.0539.36
5.2.150.0120.0369.35
5.2.140.0130.0319.35
5.2.130.0150.0579.31
5.2.120.0110.0299.31
5.2.110.0110.0329.31
5.2.100.0160.0559.31
5.2.90.0200.0549.31
5.2.80.0110.0349.30
5.2.70.0150.0589.30
5.2.60.0180.0549.25
5.2.50.0100.0359.22
5.2.40.0190.0529.20
5.2.30.0090.0329.17
5.2.20.0100.0309.17
5.2.10.0080.0339.08
5.2.00.0120.0408.93
5.1.60.0090.0268.22
5.1.50.0090.0318.21
5.1.40.0190.0508.20
5.1.30.0130.0318.54
5.1.20.0190.0588.57
5.1.10.0210.0498.29
5.1.00.0150.0558.29
5.0.50.0090.0276.78
5.0.40.0110.0506.64
5.0.30.0080.0456.45
5.0.20.0070.0246.44
5.0.10.0080.0236.42
5.0.00.0130.0646.41
4.4.90.0160.0394.82
4.4.80.0050.0194.81
4.4.70.0050.0194.80
4.4.60.0180.0374.81
4.4.50.0050.0194.82
4.4.40.0140.0524.81
4.4.30.0050.0204.81
4.4.20.0060.0194.87
4.4.10.0160.0394.88
4.4.00.0060.0294.84
4.3.110.0160.0374.75
4.3.100.0050.0174.74
4.3.90.0050.0184.75
4.3.80.0120.0524.75
4.3.70.0070.0164.74
4.3.60.0040.0204.75
4.3.50.0070.0164.74
4.3.40.0160.0464.70
4.3.30.0040.0163.51
4.3.20.0070.0453.49
4.3.10.0040.0163.45
4.3.00.0030.0206.40

preferences:
37.44 ms | 401 KiB | 5 Q