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 = 10000; 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.0101.99016.86
7.3.10.0531.88214.83
7.3.00.0771.91414.97
7.2.130.0771.99915.11
7.2.120.0572.00515.04
7.2.110.0671.95715.14
7.2.100.0831.93215.17
7.2.90.0631.97715.18
7.2.80.0872.15315.10
7.2.70.0671.99915.04
7.2.60.0602.04314.99
7.2.50.0731.99014.91
7.2.40.0602.09215.14
7.2.30.0801.98715.29
7.2.20.0131.97615.07
7.2.10.0862.01115.04
7.1.250.0992.13414.13
7.1.240.1132.16013.59
7.1.230.0672.09813.68
7.1.220.0962.13714.05
7.1.210.0572.02413.95
7.1.200.0532.12613.98
7.1.190.0732.06514.13
7.1.180.0712.11814.07
7.1.170.0502.17813.94
7.1.160.0672.14213.83
7.1.150.0672.10414.09
7.1.140.0532.12313.84
7.1.130.0572.13914.04
7.1.70.0032.49817.89
7.1.60.0072.49417.89
7.1.50.0072.43917.89
7.1.40.0032.36717.89
7.1.30.0072.35217.89
7.1.20.0072.38217.89
7.1.10.0032.28517.89
7.1.00.0031.95417.89
7.0.330.0832.35313.59
7.0.320.0792.15213.69
7.0.310.1032.14313.45
7.0.300.0802.22313.63
7.0.290.0662.29713.46
7.0.280.1072.11213.63
7.0.270.0632.08613.79
7.0.200.0002.50017.89
7.0.190.0002.47417.89
7.0.180.0072.25417.89
7.0.170.0002.42517.89
7.0.160.0002.50117.89
7.0.150.1202.12517.89
7.0.140.0072.09817.89
7.0.130.0002.16317.89
7.0.120.0172.18317.89
7.0.110.0032.23817.89
7.0.100.0032.22017.89
7.0.90.0072.23417.89
7.0.80.0002.28217.89
7.0.70.0132.18617.89
7.0.60.0002.38317.89
7.0.50.0032.32817.89
7.0.40.0032.29417.89
7.0.30.0002.34517.89
7.0.20.0102.35717.89
7.0.10.0002.36117.89
7.0.00.0032.30517.89
5.6.380.0102.42114.05
5.6.370.0302.40614.28
5.6.360.0202.44514.49
5.6.350.0232.43714.64
5.6.340.0232.42814.23
5.6.330.0272.42014.31
5.6.300.0072.14820.94
5.6.290.0072.00320.86
5.6.280.0132.16421.04
5.6.270.0071.89920.91
5.6.260.0132.04621.05
5.6.250.0002.23020.82
5.6.240.0102.09120.90
5.6.230.0072.15620.77
5.6.220.0132.19220.87
5.6.210.0032.41721.00
5.6.200.0032.26820.89
5.6.190.0072.30320.85
5.6.180.0032.30320.86
5.6.170.0032.30920.95
5.6.160.0102.34420.95
5.6.150.0002.34321.00
5.6.140.0072.29120.96
5.6.130.0072.27620.77
5.6.120.0102.32020.77
5.6.110.0002.25320.99
5.6.100.0032.27720.82
5.6.90.0072.39420.93
5.6.80.0002.40720.21
5.6.70.0032.42320.19
5.6.60.0072.40520.14
5.6.50.0002.41320.37
5.6.40.0002.42420.17
5.6.30.0072.42420.25
5.6.20.0032.43920.22
5.6.10.0002.40120.32
5.6.00.0032.38620.25
5.5.380.0072.37717.89
5.5.370.0072.33917.89
5.5.360.0032.36217.89
5.5.350.0072.43317.89
5.5.340.0032.47017.95
5.5.330.0102.45417.99
5.5.320.0032.46818.02
5.5.310.0032.46218.04
5.5.300.0102.45417.89
5.5.290.0102.43618.02
5.5.280.0002.45417.94
5.5.270.0032.46717.89
5.5.260.0002.46518.03
5.5.250.0032.46417.89
5.5.240.0032.46817.89
5.5.230.0032.46417.89
5.5.220.0002.47017.89
5.5.210.0972.37017.89
5.5.200.0032.46717.89
5.5.190.0032.46617.89
5.5.180.0002.45617.89
5.5.160.0072.46017.89
5.5.150.0072.46217.89
5.5.140.0032.46117.89
5.5.130.0072.46317.00
5.5.120.0002.47417.15
5.5.110.0032.47817.00
5.5.100.0032.46316.92
5.5.90.0032.46217.21
5.5.80.0032.46617.26
5.5.70.0072.46217.19
5.5.60.0072.46016.93
5.5.50.0032.46417.17
5.5.40.0002.47017.21
5.5.30.0032.47417.23
5.5.20.0172.45217.23
5.5.10.0002.47117.23
5.5.00.0032.46217.23
5.4.450.0032.44619.09
5.4.440.0002.47219.05
5.4.430.0072.45219.30
5.4.420.0132.45619.23
5.4.410.0002.48118.95
5.4.400.0072.46018.91
5.4.390.0032.47118.79
5.4.380.0072.45818.94
5.4.370.0072.46418.72
5.4.360.0002.47518.98
5.4.350.0072.46118.98
5.4.340.0002.47718.74
5.4.320.0072.46318.77
5.4.310.0102.46418.92
5.4.300.0032.46918.73
5.4.290.0072.46318.99
5.4.280.0032.47519.04
5.4.270.0072.46318.95
5.4.260.0002.46918.80
5.4.250.0072.45718.86
5.4.240.0072.45818.96
5.4.230.0032.46618.91
5.4.220.0002.47119.03
5.4.210.0032.46818.88
5.4.200.0032.47218.99
5.4.190.0072.46719.04
5.4.180.0002.47518.91
5.4.170.0002.46218.75
5.4.160.2132.24818.80
5.4.150.0072.45619.02
5.4.140.0002.45516.50
5.4.130.0002.45916.36
5.4.120.0072.46916.38
5.4.110.0032.47416.41
5.4.100.0072.45816.39
5.4.90.0102.47216.51
5.4.80.0032.45216.39
5.4.70.0032.44916.49
5.4.60.0072.45316.52
5.4.50.0072.45716.57
5.4.40.0072.44916.49
5.4.30.0102.44916.48
5.4.20.0032.48116.34
5.4.10.0072.45216.50
5.4.00.0072.43816.03
5.3.290.0072.45717.89
5.3.280.0032.45515.22
5.3.270.0032.45815.22
5.3.260.0072.45715.22
5.3.250.0072.43315.22
5.3.240.0002.46515.22
5.3.230.0072.45515.22
5.3.220.0002.45115.22
5.3.210.0032.46015.22
5.3.200.0072.43715.22
5.3.190.0702.39015.22
5.3.180.0032.45515.22
5.3.170.0032.46415.22
5.3.160.0072.46215.22
5.3.150.0032.45515.22
5.3.140.0032.44215.22
5.3.130.0002.45815.22
5.3.120.0032.46515.22
5.3.110.0032.46414.59
5.3.100.0002.46913.96
5.3.90.0002.46614.01
5.3.80.0132.42713.95
5.3.70.0102.44913.86
5.3.60.0632.39814.02
5.3.50.0032.45513.80
5.3.40.0172.44713.80
5.3.30.0032.45413.57
5.3.20.0102.43713.55
5.3.10.0132.44713.68
5.3.00.0002.46213.67

preferences:
35.18 ms | 400 KiB | 5 Q