3v4l.org

run code in 300+ PHP versions simultaneously
<?php set_time_limit(0); echo "<pre>"; function m1($total) { for($i = 0; $i < $total; $i ++) hash('md5', 'string'); } function m2($total) { for($i = 0; $i < $total; $i ++) md5('string'); } function m3($total) { for($i = 0; $i < $total; $i ++) hash('crc32b', 'string'); } function m4($total) { for($i = 0; $i < $total; $i ++) sha1('string'); } function m5($total) { for($i = 0; $i < $total; $i ++) hash('md5', $i); } function m6($total) { for($i = 0; $i < $total; $i ++) md5($i); } function m7($total) { for($i = 0; $i < $total; $i ++) hash('sha1', $i); } function m8($total) { for($i = 0; $i < $total; $i ++) sha1($i); } $result = array( 'm1' => 0, 'm2' => 0, 'm3' => 0, 'm4' => 0, 'm5' => 0, 'm6' => 0, 'm7' => 0, 'm8' => 0 ); $total = 1000; for($i = 0; $i < 100; ++ $i) { foreach ( array_keys($result) as $key ) { $alpha = microtime(true); $key($total); $result[$key] += microtime(true) - $alpha; } } echo '<pre>'; echo "Single Run\n"; print_r($result); echo '</pre>'; ?>

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.1.70.0100.21117.39
7.1.60.0070.25919.82
7.1.50.0100.20117.03
7.1.00.0000.24022.33
7.0.200.0100.19816.73
7.0.140.0000.34021.95
7.0.60.0170.25719.95
7.0.50.0230.28717.89
7.0.40.0170.29320.24
7.0.30.0300.29320.19
7.0.20.0270.32320.34
7.0.10.0270.30020.33
7.0.00.0130.30720.36
5.6.280.0030.38020.83
5.6.210.0200.36320.76
5.6.200.0000.38318.13
5.6.190.0000.31720.55
5.6.180.3400.31320.58
5.6.170.0300.35320.50
5.6.160.0030.38320.45
5.6.150.0030.30718.14
5.6.140.0100.35718.25
5.6.130.0030.36318.18
5.6.120.0070.38321.05
5.6.110.0270.36321.13
5.6.100.0100.35321.05
5.6.90.0130.37321.11
5.6.80.0070.30320.54
5.6.70.0270.35320.45
5.5.350.0200.37020.48
5.5.340.0100.37018.05
5.5.330.0100.32020.13
5.5.320.0300.37020.35
5.5.310.0370.34720.24
5.5.300.0070.38718.09
5.5.290.0000.39718.09
5.5.280.0070.31320.99
5.5.270.0200.36720.89
5.5.260.0030.37020.77
5.5.250.0130.37020.63
5.5.240.0070.38320.14
5.4.450.0200.31719.30
5.4.440.0170.30019.56
5.4.430.0200.37019.54
5.4.420.0330.35019.55
5.4.410.0270.42319.14
5.4.400.0230.34319.08
5.4.390.0230.34319.16
5.4.380.0270.29018.98
5.4.370.1130.31018.89
5.4.360.0270.34719.24
5.4.350.0200.32318.98
5.4.340.0300.35019.13
5.4.320.0170.32018.87
5.4.310.0300.34719.22
5.4.300.0270.34019.21
5.4.290.0330.35019.31
5.4.280.0200.31719.21
5.4.270.0170.30019.13
5.4.260.0230.31718.93
5.4.250.0270.34719.14
5.4.240.0200.29719.05
5.4.230.0230.37719.17
5.4.220.0230.30719.23
5.4.210.0400.34718.98
5.4.200.0200.33719.08
5.4.190.0170.30718.85
5.4.180.0170.29319.07
5.4.170.0270.36319.21
5.4.160.0200.31719.04
5.4.150.0270.28319.29
5.4.140.0270.30016.55
5.4.130.0300.35016.39
5.4.120.0170.30716.56
5.4.110.0270.34316.45
5.4.100.0330.33316.50
5.4.90.0370.36016.32
5.4.80.0230.35716.22
5.4.70.0330.32316.59
5.4.60.0270.35016.43
5.4.50.0200.29716.42
5.4.40.0230.35316.38
5.4.30.0270.35016.48
5.4.20.0400.33716.47
5.4.10.0300.34716.50
5.4.00.0200.33315.75
5.3.290.0230.38714.65
5.3.280.0230.35014.61
5.3.270.0230.42714.64
5.3.260.0270.37314.54
5.3.250.0100.37314.63
5.3.240.0270.43314.53
5.3.230.0330.40314.62
5.3.220.0270.37314.60
5.3.210.0230.39014.63
5.3.200.0300.38714.56
5.3.190.0270.38314.50
5.3.180.0200.33314.63
5.3.170.0200.33314.49
5.3.160.0270.38314.55
5.3.150.0230.35714.73
5.3.140.0230.39314.59
5.3.130.0400.36714.58
5.3.120.0270.32314.72
5.3.110.0330.35714.79
5.3.100.0970.32014.07
5.3.90.0170.32014.05
5.3.80.0170.36314.09
5.3.70.0170.37314.18
5.3.60.0200.32714.01
5.3.50.0230.31714.04
5.3.40.0230.34013.88
5.3.30.0170.31714.14
5.3.20.0230.34713.63
5.3.10.0330.40013.67
5.3.00.0930.30313.57
5.2.170.0200.32711.76
5.2.160.0200.33011.76
5.2.150.0970.33011.76
5.2.140.0200.37011.76
5.2.130.0230.39311.76
5.2.120.0930.35311.76
5.2.110.0170.41711.76
5.2.100.0270.43311.76
5.2.90.0230.42011.76
5.2.80.0200.40711.76
5.2.70.0230.40711.76
5.2.60.0230.36711.76
5.2.50.0200.40011.76
5.2.40.0200.43711.76
5.2.30.0270.39011.76
5.2.20.0200.89311.76
5.2.10.0200.96311.76
5.2.00.0200.96311.76
5.1.60.0200.91711.76
5.1.50.0130.88711.76
5.1.40.0130.98711.76
5.1.30.0131.20711.76
5.1.20.0100.95311.76
5.1.10.0170.05011.76
5.1.00.0230.04711.76
5.0.50.0130.04011.76
5.0.40.0070.03011.76
5.0.30.0070.05311.76
5.0.20.0170.03711.76
5.0.10.0100.03011.76
5.0.00.0170.05711.76
4.4.90.0130.03311.76
4.4.80.0070.02011.76
4.4.70.0100.02711.76
4.4.60.0130.03011.76
4.4.50.0130.02311.76
4.4.40.0100.05011.76
4.4.30.0100.01711.76
4.4.20.0070.03711.76
4.4.10.0070.03011.76
4.4.00.0070.03711.76
4.3.110.0100.02311.76
4.3.100.0100.01711.76
4.3.90.0130.02311.76
4.3.80.0100.03011.76
4.3.70.0100.03311.76
4.3.60.0100.03311.76
4.3.50.0100.02011.76
4.3.40.0030.03011.76
4.3.30.0030.02311.76
4.3.20.0030.04011.76
4.3.10.0030.04011.76
4.3.00.0030.02711.76

preferences:
37.43 ms | 400 KiB | 5 Q