3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string1 = 'aaaaaaaaaaaaaaaaaaaa'; $string2 = 'bbbbbbbbbbbbbbbbbbbb'; $string3 = 'cccccccccccccccccccc'; $string4 = 'dddddddddddddddddddd'; $string5 = 'eeeeeeeeeeeeeeeeeeee'; $results = array(); $time1 = microtime(true); for ($i = 0; $i<1000000; $i++) { $concatTest1 = $string1 . $string2 . $string3 . $string4 . $string5; } unset($i); $time2 = microtime(true); $testDuration1 = $time2 - $time1; $results['Test1'] = $testDuration1; $time3 = microtime(true); for ($i = 0; $i<1000000; $i++) { $concatTest2 = "{$string1}{$string2}{$string3}{$string4}{$string5}"; } unset($i); $time4 = microtime(true); $testDuration2 = $time4 - $time3; $results['Test2'] = $testDuration2; $time5 = microtime(true); for ($i = 0; $i<1000000; $i++) { $concatTest3 = implode('', array( $string1, $string2, $string3, $string4, $string5 )); } unset($i); $time6 = microtime(true); $testDuration3 = $time6 - $time5; $results['Test3'] = $testDuration3;

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.10.0100.71314.72
7.4.00.0100.72115.20
7.3.130.0130.74214.96
7.3.120.0030.64115.05
7.3.110.0070.73115.02
7.3.100.0000.62314.90
7.3.90.0070.55814.81
7.3.80.0030.71714.80
7.3.70.0030.56514.82
7.3.60.0100.53514.94
7.3.50.0030.72314.88
7.3.40.0030.71114.84
7.3.30.0030.61214.53
7.3.20.0130.56516.67
7.3.10.0030.56716.48
7.3.00.0070.53616.65
7.2.260.0100.63814.95
7.2.250.0180.68515.11
7.2.240.0070.80614.86
7.2.230.0070.70115.27
7.2.220.0030.82915.24
7.2.210.0070.83114.87
7.2.200.0030.83715.31
7.2.190.0030.74614.96
7.2.180.0000.82815.09
7.2.170.0000.85815.09
7.2.160.0130.57214.78
7.2.150.0030.80016.99
7.2.140.0030.83717.00
7.2.130.0040.66716.97
7.2.120.0100.59716.91
7.2.110.0030.67116.88
7.2.100.0040.67716.77
7.2.90.0020.69316.74
7.2.80.0040.67516.97
7.2.70.0090.62316.76
7.2.60.0040.64716.64
7.2.50.0060.66916.80
7.2.40.0060.65616.80
7.2.30.0060.60416.84
7.2.20.0060.66316.77
7.2.10.0070.62516.65
7.2.00.0060.64016.88
7.1.330.0070.78416.04
7.1.320.0070.95815.65
7.1.310.0100.78315.96
7.1.300.0030.91115.61
7.1.290.0100.95515.93
7.1.280.0000.98115.82
7.1.270.0070.95815.78
7.1.260.0130.96615.98
7.1.250.0040.74815.82
7.1.240.0100.97215.86
7.1.230.0100.77915.69
7.1.220.0070.84715.77
7.1.210.0030.94415.80
7.1.200.0030.77015.88
7.1.190.0070.93915.79
7.1.180.0030.77415.65
7.1.170.0030.84415.71
7.1.160.0070.94815.72
7.1.150.0030.92915.92
7.1.140.0100.78215.63
7.1.130.0100.94415.65
7.1.120.0000.89315.85
7.1.110.0000.78615.94
7.1.100.0070.96415.68
7.1.90.0030.98715.82
7.1.80.0030.86215.77
7.1.70.0050.61416.43
7.1.60.0070.61517.66
7.1.50.0070.68316.42
7.1.40.0070.88915.79
7.1.30.0030.97815.76
7.1.20.0070.97015.75
7.1.10.0070.81615.60
7.1.00.0000.63519.12
7.0.330.0100.91515.35
7.0.320.0070.87215.50
7.0.310.0030.77115.41
7.0.300.0070.78215.35
7.0.290.0000.86915.15
7.0.280.0030.97615.36
7.0.270.0030.87915.45
7.0.260.0000.86515.58
7.0.250.0070.97115.45
7.0.240.0030.86315.40
7.0.230.0030.96915.16
7.0.220.0000.84015.44
7.0.210.0070.88715.43
7.0.200.0030.62016.10
7.0.190.0030.79015.49
7.0.180.0030.97715.43
7.0.170.0070.96315.23
7.0.160.0070.76915.39
7.0.150.0030.96915.42
7.0.140.0030.71418.77
7.0.130.0030.92715.52
7.0.120.0030.97515.38
7.0.110.0030.96515.33
7.0.100.0030.96515.41
7.0.90.0070.76415.33
7.0.80.0070.90715.11
7.0.70.0070.78715.27
7.0.60.0190.68817.77
7.0.50.0120.65716.68
7.0.40.0100.68216.74
7.0.30.0150.63016.76
7.0.20.0150.70416.75
7.0.10.0100.72716.75
7.0.00.0070.59816.91
5.6.400.0031.76014.38
5.6.390.0031.59314.13
5.6.380.0071.72914.24
5.6.370.0071.57314.44
5.6.360.0101.70714.23
5.6.350.0001.71514.53
5.6.340.0031.61614.86
5.6.330.0001.72114.70
5.6.320.0031.37514.79
5.6.310.0001.71914.04
5.6.300.0071.67214.42
5.6.290.0071.38014.04
5.6.280.0071.24317.58
5.6.270.0031.71614.53
5.6.260.0031.66414.42
5.6.250.0071.60914.68
5.6.240.0071.49014.78
5.6.230.0071.71414.55
5.6.220.0071.62014.43
5.6.210.0081.08217.51
5.6.200.0071.23216.31
5.6.190.0131.20317.56
5.6.180.0151.16517.53
5.6.170.0171.22517.49
5.6.160.0061.09517.39
5.6.150.0171.02017.37
5.6.140.0121.27817.43
5.6.130.0781.14217.49
5.6.120.0071.21917.36
5.6.110.0121.05217.39
5.6.100.0121.20417.41
5.6.90.0121.21117.30
5.6.80.0121.08416.87
5.6.70.0121.23316.93
5.6.60.0131.21117.07
5.6.50.0121.04416.84
5.6.40.0151.11017.08
5.6.30.0241.04016.91
5.6.20.0121.26716.96
5.6.10.0201.28016.96
5.6.00.0121.24016.83
5.5.380.0031.72814.23
5.5.370.0071.66814.34
5.5.360.0031.74314.05
5.5.350.0021.15917.35
5.5.340.0071.26816.16
5.5.330.0121.04917.24
5.5.320.0121.31317.23
5.5.310.0101.17917.25
5.5.300.0171.23817.04
5.5.290.0131.19917.34
5.5.280.0121.24417.36
5.5.270.0121.06517.17
5.5.260.0121.11617.19
5.5.250.0121.23017.05
5.5.240.0121.23516.89
5.5.230.0171.24016.78
5.5.220.0131.09416.84
5.5.210.0151.24216.79
5.5.200.0081.23816.65
5.5.190.0151.08516.90
5.5.180.0081.19516.91
5.5.170.0071.37314.53
5.5.160.0101.17716.96
5.5.150.0151.06316.86
5.5.140.0101.17417.10
5.5.130.0071.16216.85
5.5.120.0101.20716.89
5.5.110.0081.11016.99
5.5.100.0081.10416.57
5.5.90.0071.25016.81
5.5.80.0151.22516.88
5.5.70.0121.20616.79
5.5.60.0181.24216.95
5.5.50.0121.19616.68
5.5.40.0161.23616.73
5.5.30.0121.10916.86
5.5.20.0121.18116.84
5.5.10.0081.26416.99
5.5.00.0101.20216.73
5.4.450.0171.19416.44
5.4.440.0121.20116.41
5.4.430.0071.26816.26
5.4.420.0101.08116.26
5.4.410.0151.24816.37
5.4.400.0171.26616.30
5.4.390.0181.11716.28
5.4.380.0521.17616.11
5.4.370.0101.16716.29
5.4.360.0081.20316.20
5.4.350.0121.18716.26
5.4.340.0081.22516.17
5.4.330.0001.50313.41
5.4.320.0151.18816.25
5.4.310.0101.19116.17
5.4.300.0081.39016.27
5.4.290.0081.02316.27
5.4.280.0131.24116.10
5.4.270.0081.13316.24
5.4.260.0551.23216.24
5.4.250.0071.23716.24
5.4.240.0131.25916.27
5.4.230.0171.06016.16
5.4.220.0131.19916.11
5.4.210.0131.21616.09
5.4.200.0231.20616.10
5.4.190.0131.02816.09
5.4.180.0121.25016.29
5.4.170.0121.10616.24
5.4.160.0121.20516.27
5.4.150.0101.04916.15
5.4.140.0121.28714.84
5.4.130.0071.07414.87
5.4.120.0771.18914.78
5.4.110.0131.24714.84
5.4.100.0121.11014.88
5.4.90.0181.05014.83
5.4.80.0151.09914.82
5.4.70.0131.14214.91
5.4.60.0171.26914.90
5.4.50.0201.23214.89
5.4.40.0151.25814.99
5.4.30.0121.21714.88
5.4.20.0181.00414.87
5.4.10.0151.05814.89
5.4.00.0101.05714.57
5.3.290.0121.23314.03
5.3.280.0131.19713.99
5.3.270.0081.16114.06
5.3.260.0121.30613.92
5.3.250.0141.23513.99
5.3.240.0101.17214.00
5.3.230.0071.33313.97
5.3.220.0121.32713.93
5.3.210.0171.29714.00
5.3.200.0151.31413.97
5.3.190.0121.28613.96
5.3.180.0101.27314.04
5.3.170.0171.33613.97
5.3.160.0151.24813.96
5.3.150.0131.32713.94
5.3.140.0081.35913.95
5.3.130.0151.25213.99
5.3.120.0121.31113.96
5.3.110.0071.26014.03
5.3.100.0121.33413.67
5.3.90.0151.13013.70
5.3.80.0101.32513.63
5.3.70.0101.27913.68
5.3.60.0151.25513.62
5.3.50.0151.30313.65
5.3.40.0071.26613.65
5.3.30.0141.18313.56
5.3.20.0101.10013.52
5.3.10.0531.05513.46
5.3.00.0151.06413.51
5.2.170.0270.94313.14
5.2.160.0130.85313.14
5.2.150.0270.79313.14
5.2.140.0170.76713.14
5.2.130.0100.77313.14
5.2.120.0100.86013.14
5.2.110.0270.83713.14
5.2.100.0170.80313.14
5.2.90.0170.82713.14
5.2.80.0130.81713.14
5.2.70.0200.83313.14
5.2.60.0170.83013.14
5.2.50.0170.77713.14
5.2.40.0130.83313.14
5.2.30.0130.77013.14
5.2.20.0130.78013.14
5.2.10.0070.95313.14
5.2.00.0100.99013.14
5.1.60.0101.09013.14
5.1.50.0101.20713.14
5.1.40.0071.10313.14
5.1.30.0101.11713.14
5.1.20.0171.20013.14
5.1.10.0131.12713.14
5.1.00.0171.19313.14
5.0.50.0131.83713.14
5.0.40.0031.76313.14
5.0.30.0101.77313.14
5.0.20.0131.73313.14
5.0.10.0001.68713.14
5.0.00.2331.71013.14
4.4.90.0071.92013.14
4.4.80.0071.79713.14
4.4.70.0072.00013.14
4.4.60.0101.88013.14
4.4.50.0031.85713.14
4.4.40.0031.88713.14
4.4.30.0032.04013.14
4.4.20.0071.89713.14
4.4.10.0101.94713.14
4.4.00.0101.82713.14
4.3.110.0031.78313.14
4.3.100.0071.82713.14
4.3.90.0071.77713.14
4.3.80.0072.03713.14
4.3.70.0001.82313.14
4.3.60.1901.84013.14
4.3.50.0031.83713.14
4.3.40.0001.77713.14
4.3.30.0101.85313.14
4.3.20.0001.76013.14
4.3.10.0071.69313.14
4.3.00.0031.98013.14

preferences:
40.15 ms | 401 KiB | 5 Q