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('sha1', '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)
8.0.30.0060.27716.95
8.0.20.0090.27116.98
8.0.10.0060.28216.95
8.0.00.0090.43317.04
7.4.160.0100.30316.69
7.4.150.0160.47116.62
7.4.140.0030.32316.46
7.4.130.0100.34016.50
7.4.120.0130.41716.58
7.4.110.0070.44716.51
7.4.100.0400.31416.64
7.4.90.0100.29916.59
7.4.80.0160.40316.44
7.4.70.0100.39216.57
7.4.60.0100.48016.56
7.4.50.0060.34216.43
7.4.40.0090.34116.25
7.4.30.0100.44116.50
7.4.20.0030.38416.45
7.4.10.0120.35616.40
7.4.00.0140.38216.43
7.3.270.0100.40416.40
7.3.260.0060.40816.39
7.3.250.0000.32516.39
7.3.240.0070.33716.36
7.3.230.0160.39616.40
7.3.220.0100.30416.37
7.3.210.0070.41216.29
7.3.200.0160.47816.32
7.3.190.0130.30116.33
7.3.180.0030.40316.31
7.3.170.0130.41916.24
7.3.160.0130.37116.34
7.3.150.0100.39416.25
7.3.140.0070.30916.27
7.3.130.0100.30916.54
7.3.120.0060.31016.39
7.3.110.0240.41616.26
7.3.100.0080.32016.38
7.3.90.0080.38016.54
7.3.80.0130.34616.59
7.3.70.0050.36216.33
7.3.60.0120.31516.50
7.3.50.0100.51716.42
7.3.40.0130.37716.44
7.3.30.0120.39716.42
7.3.20.0130.38416.58
7.3.10.0110.36016.38
7.3.00.0100.31916.40
7.2.340.0200.32016.53
7.2.330.0320.42616.47
7.2.320.0140.33216.39
7.2.310.0170.39616.36
7.2.300.0260.32716.43
7.2.290.0130.40216.46
7.2.280.0100.34616.44
7.2.270.0230.32216.38
7.2.260.0180.35316.46
7.2.250.0120.36616.48
7.2.240.0300.38616.51
7.2.230.0120.42716.45
7.2.220.0140.33116.55
7.2.210.0160.40016.51
7.2.200.0150.41716.67
7.2.190.0160.39316.53
7.2.180.0140.34516.57
7.2.170.0150.42516.65
7.2.160.0100.33516.60
7.2.150.0210.35316.74
7.2.140.0980.42016.65
7.2.130.0160.33016.71
7.2.120.0250.46416.62
7.2.110.0210.36116.74
7.2.100.0180.39516.77
7.2.90.0230.40516.62
7.2.80.0160.38516.67
7.2.70.0170.38316.68
7.2.60.0200.46316.72
7.2.50.0610.40316.71
7.2.40.0240.41716.77
7.2.30.0180.46716.67
7.2.20.0100.43616.67
7.2.10.0180.40916.77
7.2.00.0110.44017.66
7.1.330.0140.42315.41
7.1.320.0120.44815.47
7.1.310.0350.44915.41
7.1.300.0210.47115.36
7.1.290.0200.47715.48
7.1.280.0210.40615.41
7.1.270.0160.36415.60
7.1.260.0190.40115.48
7.1.250.0150.51515.41
7.1.240.0180.45815.38
7.1.230.0180.36415.46
7.1.220.0110.37915.49
7.1.210.0200.41515.46
7.1.200.0220.44715.47
7.1.190.0190.39215.58
7.1.180.0200.44515.45
7.1.170.0210.42015.52
7.1.160.0200.35015.48
7.1.150.0230.48715.31
7.1.140.0180.39915.60
7.1.130.0190.54915.46
7.1.120.0220.42815.37
7.1.110.0210.43715.61
7.1.100.0150.44815.41
7.1.90.0210.43715.46
7.1.80.0200.37815.59
7.1.70.0140.34216.02
7.1.60.0200.36216.77
7.1.50.0220.36716.10
7.1.40.0230.35615.67
7.1.30.0200.40715.53
7.1.20.0160.46415.42
7.1.10.0270.38815.53
7.1.00.0160.46417.80
7.0.330.0180.54614.97
7.0.320.0210.35915.08
7.0.310.0220.50015.11
7.0.300.0190.42515.21
7.0.290.0180.45615.12
7.0.280.0180.46515.14
7.0.270.0250.51115.17
7.0.260.0210.52415.11
7.0.250.0150.43515.28
7.0.240.0450.49015.38
7.0.230.0210.39615.38
7.0.220.0190.54015.28
7.0.210.0200.44615.19
7.0.200.0150.36815.17
7.0.190.0260.38115.22
7.0.180.0140.37715.22
7.0.170.0160.41615.25
7.0.160.0160.38215.21
7.0.150.0180.39515.27
7.0.140.0150.38917.63
7.0.130.0190.35415.20
7.0.120.0370.37315.20
7.0.110.0150.40415.29
7.0.100.0220.40215.25
7.0.90.0180.45415.15
7.0.80.0140.37115.09
7.0.70.0140.42115.21
7.0.60.0120.36916.82
7.0.50.0110.42216.13
7.0.40.0430.43416.05
7.0.30.0140.38816.06
7.0.20.0100.38916.06
7.0.10.0170.38716.06
7.0.00.0160.40516.00
5.6.400.0150.65115.95
5.6.390.0170.52715.98
5.6.380.0210.51715.80
5.6.370.0120.55315.89
5.6.360.0180.49815.89
5.6.350.0160.66515.82
5.6.340.0150.53915.87
5.6.330.0230.47715.91
5.6.320.0260.49815.81
5.6.310.0200.59916.08
5.6.300.0230.50915.70
5.6.290.0180.50915.77
5.6.280.0120.47217.65
5.6.270.0090.56415.92
5.6.260.0180.55415.93
5.6.250.0150.59815.88
5.6.240.0320.57215.91
5.6.230.0180.52715.80
5.6.220.0290.65615.98
5.6.210.0150.43717.38
5.6.200.0210.46916.59
5.6.190.0150.49916.64
5.6.180.0230.59716.71
5.6.170.0140.52016.74
5.6.160.0180.46016.55
5.6.150.0120.52716.73
5.6.140.0140.50816.69
5.6.130.0160.46816.60
5.6.120.0140.50116.77
5.6.110.0130.46116.60
5.6.100.0170.48116.63
5.6.90.0110.45116.71
5.6.80.0140.49716.52
5.6.70.0110.55716.45
5.6.60.0140.45016.39
5.6.50.0180.45016.51
5.6.40.0140.49116.46
5.6.30.0260.52116.50
5.6.20.0140.45316.43
5.6.10.0180.46216.40
5.6.00.0250.49316.40
5.5.380.0280.60215.97
5.5.370.0230.52215.95
5.5.360.0260.60215.86
5.5.350.0170.51017.41
5.5.340.0210.60216.62
5.5.330.0140.52416.64
5.5.320.0190.50516.57
5.5.310.0180.47616.63
5.5.300.0290.45816.68
5.5.290.0080.48716.53
5.5.280.0140.51616.53
5.5.270.0150.45616.61
5.5.260.0160.55516.64
5.5.250.0100.47316.56
5.5.240.0170.51716.46
5.5.230.0130.51916.41
5.5.220.0130.42516.35
5.5.210.0110.44416.36
5.5.200.0130.51116.38
5.5.190.0130.49516.34
5.5.180.0160.55016.41
5.5.170.0160.58315.80
5.5.160.0160.59516.31
5.5.150.0150.46416.35
5.5.140.0120.53216.24
5.5.130.0140.51816.27
5.5.120.0140.47416.21
5.5.110.0120.44716.29
5.5.100.0150.44816.39
5.5.90.0170.52216.35
5.5.80.0130.45516.31
5.5.70.0180.46716.37
5.5.60.0140.51216.31
5.5.50.0210.48516.25
5.5.40.0130.47516.38
5.5.30.0170.49616.42
5.5.20.0180.51716.30
5.5.10.0150.51116.28
5.5.00.0200.46316.11
5.4.450.0120.48115.17
5.4.440.0150.50515.02
5.4.430.0130.42115.07
5.4.420.0150.44215.04
5.4.410.0130.50015.09
5.4.400.0150.47815.09
5.4.390.0200.47714.90
5.4.380.0130.51614.93
5.4.370.0140.51114.89
5.4.360.0190.52914.92
5.4.350.0120.55014.96
5.4.340.0120.54214.93
5.4.330.0200.64212.95
5.4.320.0170.46115.00
5.4.310.0180.47514.88
5.4.300.0140.49514.93
5.4.290.0130.48714.92
5.4.280.0110.49514.99
5.4.270.0140.44714.96
5.4.260.0140.52714.99
5.4.250.0130.53814.92
5.4.240.0080.59315.02
5.4.230.0170.53314.90
5.4.220.0160.51714.99
5.4.210.0130.46914.95
5.4.200.0090.49114.95
5.4.190.0180.49814.96
5.4.180.0180.49414.99
5.4.170.0200.54614.92
5.4.160.0100.41814.86
5.4.150.0150.45214.89
5.4.140.0120.56114.14
5.4.130.0170.49014.12
5.4.120.0120.44114.06
5.4.110.0120.45214.12
5.4.100.0080.53914.06
5.4.90.0160.56214.15
5.4.80.0090.49814.07
5.4.70.0090.51114.19
5.4.60.0120.52214.04
5.4.50.0120.48414.14
5.4.40.0150.48314.15
5.4.30.0110.50514.04
5.4.20.0130.46314.06
5.4.10.0120.46014.15
5.4.00.0100.44413.86
5.3.290.0090.47613.81
5.3.280.0110.60013.58
5.3.270.0190.64413.72
5.3.260.0200.57613.63
5.3.250.0160.66413.62
5.3.240.0130.66013.60
5.3.230.0110.57913.63
5.3.220.0080.53913.58
5.3.210.0140.53213.55
5.3.200.0110.60413.63
5.3.190.0530.52213.55
5.3.180.0170.64113.68
5.3.170.0120.61513.58
5.3.160.0150.52813.62
5.3.150.0130.54413.63
5.3.140.0120.53613.64
5.3.130.0110.52213.60
5.3.120.0130.58513.64
5.3.110.0120.52513.54
5.3.100.0180.53313.40
5.3.90.0130.56513.46
5.3.80.0140.53913.40
5.3.70.0150.57313.35
5.3.60.0080.51313.39
5.3.50.0130.50013.42
5.3.40.0110.56313.45
5.3.30.0170.53413.44
5.3.20.0110.51413.27
5.3.10.0080.53113.17
5.3.00.0100.49413.22
5.2.170.0110.62012.11
5.2.160.0130.58812.04
5.2.150.0110.59812.12
5.2.140.0130.62312.15
5.2.130.0070.61712.08
5.2.120.0060.52712.10
5.2.110.0020.50512.05
5.2.100.0060.51512.03
5.2.90.0130.57812.02
5.2.80.0080.54912.12
5.2.70.0100.57312.11
5.2.60.0110.55112.19
5.2.50.0080.47311.98
5.2.40.0060.52912.06
5.2.30.0080.60512.05
5.2.20.0031.31412.03
5.2.10.0221.07211.97
5.2.00.0081.34211.86
5.1.60.0081.33711.58
5.1.50.0101.25611.53
5.1.40.0131.29311.51
5.1.30.0081.21111.82
5.1.20.0071.25211.76
5.1.10.0090.03111.63
5.1.00.0090.02711.58
5.0.50.0100.02110.82
5.0.40.0040.02710.78
5.0.30.0100.02810.72
5.0.20.0030.01810.61
5.0.10.0040.02510.68
5.0.00.0020.02210.74
4.4.90.0040.01010.61
4.4.80.0030.00810.61
4.4.70.0070.01810.61
4.4.60.0000.01510.61
4.4.50.0020.01910.61
4.4.40.0020.02610.61
4.4.30.0070.01710.61
4.4.20.0000.02010.61
4.4.10.0050.01810.61
4.4.00.0020.01910.61
4.3.110.0080.01310.61
4.3.100.0050.01310.61
4.3.90.0040.01810.61
4.3.80.0000.01710.61
4.3.70.0050.01710.61
4.3.60.0040.01710.61
4.3.50.0040.01910.61
4.3.40.0050.02710.61
4.3.30.0030.01810.61
4.3.20.0020.01810.61
4.3.10.0030.02010.61
4.3.00.0000.02110.61

preferences:
42.73 ms | 401 KiB | 5 Q