3v4l.org

run code in 300+ PHP versions simultaneously
<?php class HashCracker { private $range = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']; private $length = 32; private $cycles = 1000; public function runBenchmark($hash, $prefix = '') { foreach ($this->range as $key) { $match = $prefix . $key; $times[$match] = microtime(true); for ($i = 0; $i < $this->cycles; $i += 1) { strcmp($hash, $match); } $times[$match] = microtime(true) - $times[$match]; } asort($times); var_dump($times, reset($times)); } } $password = 'hello'; $hashed = md5($password); var_dump('Hash to match: ' . $hashed); (new HashCracker())->runBenchmark($hashed);

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.60.0160.00815.86
7.4.50.0140.00716.09
7.4.40.0200.01016.13
7.4.30.0200.00016.25
7.4.20.0040.01815.89
7.4.10.0150.00815.74
7.4.00.0100.00916.02
7.3.180.0160.00516.32
7.3.170.0170.00316.27
7.3.160.0130.00716.13
7.3.150.0130.00916.50
7.3.140.0130.00716.18
7.3.130.0050.01616.09
7.3.120.0130.00715.53
7.3.110.0210.01215.70
7.3.100.0080.00815.76
7.3.90.0120.00615.58
7.3.80.0050.01115.55
7.3.70.0090.01115.63
7.3.60.0090.00615.46
7.3.50.0060.01015.62
7.3.40.0110.01215.56
7.3.30.0110.01415.46
7.3.20.0140.01017.18
7.3.10.0190.01017.44
7.3.00.0120.00417.32
7.2.310.0190.00316.37
7.2.300.0120.00916.20
7.2.290.0110.01116.33
7.2.280.0040.01616.31
7.2.270.0040.01816.52
7.2.260.0190.00216.46
7.2.250.0100.01015.78
7.2.240.0130.01015.79
7.2.230.0060.01215.52
7.2.220.0080.00815.76
7.2.210.0080.01115.85
7.2.200.0120.00915.80
7.2.190.0070.01015.79
7.2.180.0060.01315.73
7.2.170.0110.01215.81
7.2.160.0070.01316.45
7.2.150.0100.01018.27
7.2.140.0080.01118.24
7.2.130.0160.00918.33
7.2.120.0060.01318.30
7.2.110.0030.01718.43
7.2.100.0140.00618.23
7.2.90.0060.01218.46
7.2.80.0030.01718.48
7.2.70.0080.01118.12
7.2.60.0180.00718.31
7.2.50.0060.01318.43
7.2.40.0080.01318.36
7.2.30.0130.00618.28
7.2.20.0090.01018.36
7.2.10.0160.01218.19
7.2.00.0110.00618.79
7.1.330.0170.01216.63
7.1.320.0120.01116.60
7.1.310.0090.01116.47
7.1.300.0030.01416.40
7.1.290.0170.01016.56
7.1.280.0040.01516.51
7.1.270.0170.00516.64
7.1.260.0080.01116.39
7.1.250.0130.00817.07
7.1.240.0260.00617.32
7.1.230.0110.01117.10
7.1.220.0110.01117.16
7.1.210.0080.01317.05
7.1.200.0160.00517.05
7.1.190.0140.01116.90
7.1.180.0160.00916.91
7.1.170.0360.00917.14
7.1.160.0070.01617.02
7.1.150.0120.01616.89
7.1.140.0140.00817.35
7.1.130.0090.01217.23
7.1.120.0030.01616.84
7.1.110.0040.01617.09
7.1.100.0060.01517.05
7.1.90.0230.00217.03
7.1.80.0090.01217.30
7.1.70.0150.00817.18
7.1.60.0120.01018.08
7.1.50.0100.01317.07
7.1.40.0070.01317.23
7.1.30.0080.01217.13
7.1.20.0300.01116.94
7.1.10.0120.00817.06
7.1.00.0080.04119.73
7.0.330.0070.01316.77
7.0.320.0070.01116.88
7.0.310.0120.00617.09
7.0.300.0220.00516.90
7.0.290.0190.00616.81
7.0.280.0060.01016.84
7.0.270.0110.00616.80
7.0.260.0110.00816.89
7.0.250.0050.01416.95
7.0.240.0080.00917.03
7.0.230.0040.01416.57
7.0.220.0000.01816.68
7.0.210.0250.01116.76
7.0.200.0080.01015.89
7.0.190.0140.00616.86
7.0.180.0100.00716.89
7.0.170.0120.00816.90
7.0.160.0110.00716.89
7.0.150.0040.01217.01
7.0.140.0080.04019.48
7.0.130.0090.00916.66
7.0.120.0070.01016.83
7.0.110.0100.00716.63
7.0.100.0250.03218.33
7.0.90.0340.04018.39
7.0.80.0220.04318.36
7.0.70.0270.04518.50
7.0.60.0180.04719.21
7.0.50.0080.03619.34
7.0.40.0200.04418.36
7.0.30.0080.04418.44
7.0.20.0070.04718.36
7.0.10.0060.04818.43
7.0.00.0040.05018.47
5.6.400.0110.01115.73
5.6.390.0180.00716.06
5.6.380.0110.01215.87
5.6.370.0070.01716.11
5.6.360.0110.01116.04
5.6.350.0100.01316.01
5.6.340.0090.01215.61
5.6.330.0090.01315.77
5.6.320.0110.01415.77
5.6.310.0130.00715.92
5.6.300.0170.01715.57
5.6.290.0040.01615.99
5.6.280.0120.03818.39
5.6.270.0130.01015.82
5.6.260.0060.01516.02
5.6.250.0100.04718.23
5.6.240.0180.04018.16
5.6.230.0240.05718.16
5.6.220.0080.05018.03
5.6.210.0070.05418.05
5.6.200.0080.05318.50
5.6.190.0100.04718.51
5.6.180.0100.04418.49
5.6.170.0240.04318.52
5.6.160.0070.05218.45
5.6.150.0080.04918.43
5.6.140.0130.04518.53
5.6.130.0100.04718.59
5.6.120.0070.05418.43
5.6.110.0140.04518.41
5.6.100.0090.04918.38
5.6.90.0130.03918.35
5.6.80.0100.04918.15
5.6.70.0150.04318.12
5.6.60.0110.04318.13
5.6.50.0110.04518.02
5.6.40.0110.04518.00
5.6.30.0050.04918.03
5.6.20.0120.04018.01
5.6.10.0090.04018.02
5.6.00.0080.04018.12
5.5.380.0100.04518.10
5.5.370.0080.05017.96
5.5.360.0100.04418.07
5.5.350.0200.04118.11
5.5.340.0160.05318.31
5.5.330.0100.04818.40
5.5.320.0230.04518.24
5.5.310.0100.04818.29
5.5.300.0070.05318.33
5.5.290.0100.04818.36
5.5.280.0080.05318.30
5.5.270.0120.04418.28
5.5.260.0080.04518.39
5.5.250.0110.04018.13
5.5.240.0080.04918.02
5.5.230.0140.04917.96
5.5.220.0120.04617.95
5.5.210.0140.04518.04
5.5.200.0120.04418.01
5.5.190.0100.04418.05
5.5.180.0090.03418.07
5.5.170.0480.01815.83
5.5.160.0050.04717.89
5.5.150.0060.04918.06
5.5.140.0020.05218.06
5.5.130.0080.04918.04
5.5.120.0080.04717.84
5.5.110.0050.04618.03
5.5.100.0100.04517.84
5.5.90.0110.04617.98
5.5.80.0170.03817.82
5.5.70.0030.04017.82
5.5.60.0050.05017.94
5.5.50.0050.04617.93
5.5.40.0160.03317.89
5.5.30.0060.04617.81
5.5.20.0070.04917.99
5.5.10.0050.04917.96
5.5.00.0100.03317.96
5.4.450.0080.04716.08
5.4.440.0110.04416.00
5.4.430.0130.04216.13
5.4.420.0100.04415.96
5.4.410.0300.03715.90
5.4.400.0040.04115.95
5.4.390.0110.04315.75
5.4.380.0150.03915.92
5.4.370.0100.04215.67
5.4.360.0110.03715.81
5.4.350.0190.04815.88
5.4.340.0070.04515.92
5.4.330.0110.00612.52
5.4.320.0090.04515.92
5.4.310.0080.04215.86
5.4.300.0130.03815.96
5.4.290.0070.03815.82
5.4.280.0090.02615.97
5.4.270.0070.04315.89
5.4.260.0090.04316.06
5.4.250.0070.04115.95
5.4.240.0060.04615.68
5.4.230.0080.04315.79
5.4.220.0050.04815.68
5.4.210.0120.03815.84
5.4.200.0100.04216.01
5.4.190.0060.04315.76
5.4.180.0070.04815.73
5.4.170.0050.04715.89
5.4.160.0090.04515.79
5.4.150.0080.04115.86
5.4.140.0080.04714.51
5.4.130.0080.04314.36
5.4.120.0070.04514.53
5.4.110.0070.04314.49
5.4.100.0080.04014.58
5.4.90.0160.03614.57
5.4.80.0060.04314.43
5.4.70.0090.04014.48
5.4.60.0120.04114.53
5.4.50.0100.04314.58
5.4.40.0140.03614.59
5.4.30.0070.04214.50
5.4.20.0080.04414.39
5.4.10.0050.03214.53
5.4.00.0090.04314.34
5.3.290.0100.03713.84
5.3.280.0100.04013.69
5.3.270.0080.04013.75
5.3.260.0030.03113.61
5.3.250.0140.03513.80
5.3.240.0070.04113.65
5.3.230.0090.04113.69
5.3.220.0070.04113.66
5.3.210.0060.04213.60
5.3.200.0110.03813.62
5.3.190.0080.04113.67
5.3.180.0060.04113.91
5.3.170.0150.03513.76
5.3.160.0050.03213.73
5.3.150.0070.03913.85
5.3.140.0110.04013.74
5.3.130.0040.04813.73
5.3.120.0060.02913.60
5.3.110.0100.04213.74
5.3.100.0110.03813.44
5.3.90.0020.04713.48
5.3.80.0030.03213.35
5.3.70.0050.03113.42
5.3.60.0090.04013.43
5.3.50.0050.04613.40
5.3.40.0050.02813.35
5.3.30.0080.03513.26
5.3.20.0050.04113.32
5.3.10.0090.02813.16
5.3.00.0020.03113.09
5.2.170.0040.03411.49
5.2.160.0040.03411.55
5.2.150.0060.03211.41
5.2.140.0100.03211.46
5.2.130.0050.03311.36
5.2.120.0020.03811.52
5.2.110.0040.03611.50
5.2.100.0070.03211.45
5.2.90.0060.02911.43
5.2.80.0060.02011.35
5.2.70.0020.03011.57
5.2.60.0000.04011.41
5.2.50.0050.03511.53
5.2.40.0070.03011.42
5.2.30.0070.03511.44
5.2.20.0110.02711.31
5.2.10.0070.03311.18
5.2.00.0060.03311.14
5.1.60.0080.02710.47
5.1.50.0060.02510.40
5.1.40.0020.03210.50
5.1.30.0050.01910.81
5.1.20.0070.02910.58
5.1.10.0060.02910.50
5.1.00.0070.02810.29
5.0.50.0060.0139.45
5.0.40.0040.0129.27
5.0.30.0030.0189.18
5.0.20.0030.0139.11
5.0.10.0030.0159.19
5.0.00.0020.0189.15
4.4.90.0050.0189.01
4.4.80.0000.0169.01
4.4.70.0050.0189.01
4.4.60.0010.0199.01
4.4.50.0040.0199.01
4.4.40.0080.0229.01
4.4.30.0020.0209.01
4.4.20.0000.0219.01
4.4.10.0020.0219.01
4.4.00.0000.0229.01
4.3.110.0000.0139.01
4.3.100.0030.0109.01
4.3.90.0030.0099.01
4.3.80.0040.0109.01
4.3.70.0010.0109.01
4.3.60.0030.0089.01
4.3.50.0020.0119.01
4.3.40.0030.0169.01
4.3.30.0000.0119.01
4.3.20.0020.0089.01
4.3.10.0030.0089.01
4.3.00.0030.0079.01

preferences:
36.68 ms | 401 KiB | 5 Q