3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string1 = 'aaaaaaaaaaaaaaaaaaaa'; $string2 = 'bbbbbbbbbbbbbbbbbbbb'; $string3 = 'cccccccccccccccccccc'; $string4 = 'dddddddddddddddddddd'; $string5 = 'eeeeeeeeeeeeeeeeeeee'; $time1 = microtime(); for ($k = 0; $k<100.00; $k++) { $concatTest1 = $string1 . $string2 . $string3 . $string4 . $string5; } $time2 = microtime(); $testDuration1 = $time2 - $time1; $time3 = microtime(); for ($m = 0; $m<100.00; $m++) { $concatTest2 = "{$string1}{$string2}{$string3}{$string4}{$string5}"; } $time4 = microtime(); $testDuration2 = $time4 - $time3; $time5 = microtime(); for ($p = 0; $p<100.00; $p++) { $concatTest3 = implode('', array($string1, $string2, $string3, $string4, $string5)); } $time6 = microtime(); $testDuration3 = $time6 - $time5; var_dump( $testDuration1, $testDuration2, $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.01015.15
7.4.00.0100.01014.93
7.3.130.0040.01414.66
7.3.120.0070.01114.53
7.3.110.0100.00615.02
7.3.100.0110.00414.94
7.3.90.0090.00914.88
7.3.80.0160.00014.95
7.3.70.0070.00714.80
7.3.60.0120.00414.66
7.3.50.0080.01114.85
7.3.40.0030.01214.91
7.3.30.0070.00714.93
7.3.20.0090.00616.72
7.3.10.0040.01416.59
7.3.00.0060.00616.87
7.2.260.0070.01415.14
7.2.250.0060.01315.32
7.2.240.0090.00315.27
7.2.230.0070.01015.37
7.2.220.0120.00315.23
7.2.210.0040.01514.96
7.2.200.0030.01015.25
7.2.190.0030.01315.10
7.2.180.0000.01115.31
7.2.170.0090.00615.21
7.2.160.0060.00915.12
7.2.150.0070.01017.10
7.2.140.0000.01516.92
7.2.130.0070.00716.97
7.2.120.0070.01316.77
7.2.110.0040.01416.99
7.2.100.0070.00716.90
7.2.90.0060.01017.02
7.2.80.0160.00017.14
7.2.70.0110.00416.65
7.2.60.0070.00716.67
7.2.50.0070.00716.95
7.2.40.0030.01316.73
7.2.30.0040.00816.88
7.2.20.0070.00716.96
7.2.10.0000.01216.81
7.2.00.0020.01218.24
7.1.330.0080.00815.87
7.1.320.0070.00715.97
7.1.310.0030.01415.83
7.1.300.0000.01715.92
7.1.290.0030.00915.71
7.1.280.0000.01416.02
7.1.270.0040.01115.82
7.1.260.0070.01115.58
7.1.250.0000.01015.91
7.1.240.0030.01315.75
7.1.230.0070.01115.99
7.1.220.0000.01115.67
7.1.210.0030.00815.82
7.1.200.0000.01415.80
7.1.190.0070.00715.63
7.1.180.0050.00315.54
7.1.170.0040.00815.61
7.1.160.0030.00715.87
7.1.150.0000.01315.87
7.1.140.0120.00315.63
7.1.130.0070.00715.49
7.1.120.0090.00615.76
7.1.110.0090.00416.00
7.1.100.0000.01215.73
7.1.90.0030.01315.75
7.1.80.0000.01515.97
7.1.70.0050.00816.40
7.1.60.0050.01117.79
7.1.50.0030.01616.50
7.1.40.0070.00715.71
7.1.30.0080.00515.85
7.1.20.0090.00615.85
7.1.10.0000.01415.69
7.1.00.0050.05019.00
7.0.330.0060.00915.62
7.0.320.0030.01215.27
7.0.310.0110.00415.48
7.0.300.0060.00615.44
7.0.290.0030.01015.20
7.0.280.0070.00715.43
7.0.270.0030.00615.51
7.0.260.0030.01515.59
7.0.250.0040.01115.50
7.0.240.0130.00015.40
7.0.230.0000.01215.58
7.0.220.0080.00815.54
7.0.210.0040.00715.48
7.0.200.0080.00616.11
7.0.190.0070.00715.41
7.0.180.0090.00615.33
7.0.170.0000.01415.16
7.0.160.0000.01715.55
7.0.150.0030.01315.32
7.0.140.0060.04018.71
7.0.130.0040.00815.46
7.0.120.0120.00315.53
7.0.110.0030.01015.48
7.0.100.0080.00715.13
7.0.90.0110.00415.53
7.0.80.0110.00415.38
7.0.70.0090.00615.68
7.0.60.0050.04617.59
7.0.50.0030.04516.67
7.0.40.0120.04016.75
7.0.30.0270.04016.85
7.0.20.0130.05016.79
7.0.10.0070.02416.77
7.0.00.0120.03316.70
5.6.400.0030.01214.15
5.6.390.0120.00314.57
5.6.380.0080.00414.69
5.6.370.0060.00314.64
5.6.360.0070.01014.23
5.6.350.0030.01014.36
5.6.340.0080.00614.61
5.6.330.0040.01114.40
5.6.320.0080.00814.46
5.6.310.0090.00614.62
5.6.300.0070.01114.66
5.6.290.0100.00314.35
5.6.280.0050.03617.70
5.6.270.0040.01214.55
5.6.260.0110.00414.77
5.6.250.0000.01214.59
5.6.240.0000.01514.42
5.6.230.0030.01214.29
5.6.220.0130.00314.30
5.6.210.0080.04317.47
5.6.200.0070.03216.28
5.6.190.0030.02517.54
5.6.180.0150.04017.29
5.6.170.0150.02617.39
5.6.160.0040.04017.40
5.6.150.0080.03516.10
5.6.140.0030.03516.22
5.6.130.0080.03316.31
5.6.120.0050.03517.61
5.6.110.0070.04917.71
5.6.100.0030.02617.61
5.6.90.0090.04117.64
5.6.80.0070.02417.37
5.6.70.0070.00714.25
5.6.60.0080.00614.27
5.6.50.0090.00614.25
5.6.40.0100.00614.27
5.6.30.0060.00614.02
5.6.20.0060.00314.16
5.6.10.0090.00614.20
5.6.00.0030.01014.25
5.5.380.0030.01014.17
5.5.370.0040.01114.12
5.5.360.0070.00414.29
5.5.350.0070.04017.23
5.5.340.0030.03816.04
5.5.330.0090.04417.17
5.5.320.0130.02517.12
5.5.310.0100.02717.23
5.5.300.0040.02316.17
5.5.290.0080.04316.07
5.5.280.0070.02917.60
5.5.270.0080.04717.50
5.5.260.0030.03117.39
5.5.250.0030.03317.42
5.5.240.0140.03417.31
5.5.230.0000.01714.10
5.5.220.0060.00914.27
5.5.210.0000.01114.21
5.5.200.0030.00614.16
5.5.190.0100.00314.18
5.5.180.0060.00913.91
5.5.170.0080.00414.29
5.5.160.0060.00914.18
5.5.150.0080.00414.38
5.5.140.0030.01014.45
5.5.130.0060.01014.28
5.5.120.0090.00614.37
5.5.110.0040.00714.34
5.5.100.0030.00914.28
5.5.90.0030.01014.49
5.5.80.0060.00914.05
5.5.70.0130.00014.11
5.5.60.0100.00714.43
5.5.50.0000.00913.96
5.5.40.0040.01114.27
5.5.30.0030.01314.05
5.5.20.0040.01214.00
5.5.10.0060.00914.16
5.5.00.0100.00614.31
5.4.450.1510.02515.21
5.4.440.1730.02115.16
5.4.430.2000.02015.31
5.4.420.0060.02015.00
5.4.410.1320.02215.20
5.4.400.1870.02515.10
5.4.390.2030.02315.13
5.4.380.1780.02414.94
5.4.370.1900.02614.89
5.4.360.1950.02115.06
5.4.350.1630.02014.98
5.4.340.1730.02414.81
5.4.330.0030.00310.73
5.4.320.1930.02615.01
5.4.310.2620.02114.79
5.4.300.1800.02014.85
5.4.290.1800.02514.92
5.4.280.1800.02714.97
5.4.270.1700.02414.86
5.4.260.1900.02214.98
5.4.250.1720.02515.13
5.4.240.1770.01714.93
5.4.230.1700.02314.88
5.4.220.1790.01815.05
5.4.210.1790.02415.01
5.4.200.1750.02214.99
5.4.190.1980.02614.80
5.4.180.1730.02014.95
5.4.170.1720.02514.90
5.4.160.1880.02315.00
5.4.150.1630.02714.97
5.4.140.1730.02213.55
5.4.130.2150.02313.64
5.4.120.1700.02113.61
5.4.110.1930.02513.68
5.4.100.2250.02113.72
5.4.90.1830.02213.70
5.4.80.1840.01913.76
5.4.70.1900.02513.59
5.4.60.1700.01813.63
5.4.50.1850.01813.59
5.4.40.2300.02513.62
5.4.30.1770.01813.73
5.4.20.1840.02213.72
5.4.10.2220.02013.67
5.4.00.2210.01713.36
5.3.290.1850.02112.57
5.3.280.1720.02212.46
5.3.270.1800.02212.45
5.3.260.1980.02112.59
5.3.250.1670.02512.54
5.3.240.1930.02812.41
5.3.230.1920.02112.46
5.3.220.1730.02312.28
5.3.210.1830.02312.41
5.3.200.2000.02012.39
5.3.190.1930.02612.49
5.3.180.2030.02312.46
5.3.170.2210.02412.34
5.3.160.1970.02212.55
5.3.150.1890.02212.53
5.3.140.1810.02212.43
5.3.130.1920.02112.45
5.3.120.1690.02012.45
5.3.110.2050.01912.35
5.3.100.1960.02212.22
5.3.90.2130.02112.19
5.3.80.2030.02412.18
5.3.70.1880.02612.17
5.3.60.2170.02312.15
5.3.50.2050.02312.14
5.3.40.2030.02112.12
5.3.30.1770.02312.10
5.3.20.2120.01811.88
5.3.10.2180.02211.70
5.3.00.2150.01911.70
5.2.170.3530.03311.02
5.2.160.3370.03311.02
5.2.150.3070.03011.07
5.2.140.3570.03011.20
5.2.130.2930.03311.13
5.2.120.3530.03310.96
5.2.110.3500.02711.05
5.2.100.3770.03710.95
5.2.90.3670.03011.02
5.2.80.0470.05010.95
5.2.70.0030.03011.16
5.2.60.0070.05711.15
5.2.50.2100.04010.96
5.2.40.2700.03010.91
5.2.30.2200.03311.13
5.2.20.2970.05311.12
5.2.10.2400.02311.01
5.2.00.2630.03010.78
5.1.60.2330.02310.09
5.1.50.2770.03010.14
5.1.40.3700.0309.97
5.1.30.2970.03010.40
5.1.20.2930.02310.34
5.1.10.3130.03010.03
5.1.00.2500.02710.01
5.0.50.1470.0178.45
5.0.40.1200.0208.38
5.0.30.1530.0378.11
5.0.20.1270.0238.14
5.0.10.1130.0208.30
5.0.00.1470.0338.30
4.4.90.0030.0337.89
4.4.80.0000.0207.89
4.4.70.1230.0107.89
4.4.60.0570.0307.89
4.4.50.1370.0177.89
4.4.40.1400.0237.89
4.4.30.1400.0137.89
4.4.20.1700.0137.89
4.4.10.1430.0177.89
4.4.00.1470.0237.89
4.3.110.1430.0207.89
4.3.100.1570.0177.89
4.3.90.1470.0137.89
4.3.80.1070.0307.89
4.3.70.0000.0207.89
4.3.60.0030.0307.89
4.3.50.0000.0377.89
4.3.40.0030.0337.89
4.3.30.0000.0277.89
4.3.20.0000.0377.89
4.3.10.0030.0307.89
4.3.00.0030.0277.89

preferences:
34.89 ms | 400 KiB | 5 Q