3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string1 = 'aaaaaaaaaaaaaaaaaaaa'; $string2 = 'bbbbbbbbbbbbbbbbbbbb'; $string3 = 'cccccccccccccccccccc'; $string4 = 'dddddddddddddddddddd'; $string5 = 'eeeeeeeeeeeeeeeeeeee'; $time1 = microtime(true); for ($k = 0; $k<10000; $k++) { $concatTest1 = $string1 . $string2 . $string3 . $string4 . $string5; } $time2 = microtime(true); $testDuration1 = $time2 - $time1; echo "Test 1 took $testDuration1 Seconds"; $time3 = microtime(true); for ($m = 0; $m<10000; $m++) { $concatTest2 = "{$string1}{$string2}{$string3}{$string4}{$string5}"; } $time4 = microtime(true); $testDuration2 = $time4 - $time3; echo "Test 2 took $testDuration2 Seconds"; $time5 = microtime(true); for ($p = 0; $p<10000; $p++) { $concatTest3 = implode('', array($string1, $string2, $string3, $string4, $string5)); } $time6 = microtime(true); $testDuration3 = $time6 - $time5; echo "Test 3 took $testDuration3 Seconds";

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.3.10.0140.01416.43
7.3.00.0160.01016.61
7.2.130.0100.01816.54
7.2.120.0120.01616.53
7.2.110.0060.02216.58
7.2.100.0180.01816.57
7.2.90.0170.01016.22
7.2.80.0100.01716.54
7.2.70.0090.01216.13
7.2.60.0090.02216.87
7.2.50.0250.01816.90
7.2.40.0110.01816.09
7.2.30.0170.01016.57
7.2.20.0200.01617.04
7.2.10.0070.02316.20
7.2.00.0100.01416.73
7.1.250.0160.01615.24
7.1.70.0030.00917.08
7.1.60.0100.02319.82
7.1.50.0060.01316.73
7.1.00.0000.08322.29
7.0.200.0030.01316.91
7.0.140.0000.08322.08
7.0.110.0270.08720.06
7.0.100.0070.08320.13
7.0.90.0130.08319.96
7.0.80.0030.09020.08
7.0.70.0070.08719.87
7.0.60.0030.09319.99
7.0.50.0070.08019.92
7.0.40.0030.08319.86
7.0.30.0100.07719.68
7.0.20.0130.07719.74
7.0.10.0200.07019.65
7.0.00.0030.09019.70
5.6.280.0100.08021.13
5.6.260.0030.09020.61
5.6.250.0130.07320.68
5.6.240.0130.08020.68
5.6.230.0230.05720.55
5.6.220.0070.09720.70
5.6.210.0070.09720.64
5.6.200.0100.09320.57
5.6.190.0070.10020.62
5.6.180.0130.08320.66
5.6.170.0000.05720.59
5.6.160.0100.09020.66
5.6.150.0070.09020.58
5.6.140.0100.05320.59
5.6.130.0130.09020.65
5.6.120.0030.09020.59
5.6.110.0030.09320.55
5.6.100.0200.08320.54
5.6.90.0070.07020.60
5.6.80.0000.05020.04
5.6.70.0170.03719.96
5.6.60.0070.04720.02
5.6.50.0070.04320.04
5.6.40.0030.04719.95
5.6.30.0000.05019.96
5.6.20.0000.07019.97
5.6.10.0070.04719.97
5.6.00.0030.04719.98
5.5.380.0030.08717.57
5.5.370.0100.08717.63
5.5.360.0100.08717.64
5.5.350.0070.08717.77
5.5.340.0130.08318.11
5.5.330.0070.09317.77
5.5.320.0100.08718.12
5.5.310.0100.05017.86
5.5.300.0130.08317.86
5.5.290.0070.09018.12
5.5.280.0100.08718.17
5.5.270.0000.10317.88
5.5.260.0200.08717.78
5.5.250.0000.07017.97
5.5.240.0030.05017.48
5.5.230.0030.04717.38
5.5.220.0000.04717.24
5.5.210.0000.07317.48
5.5.200.0000.05017.51
5.5.190.0000.04717.51
5.5.180.0100.07717.51
5.5.160.0000.06317.22
5.5.150.0000.04317.19
5.5.140.0070.04017.37
5.5.130.0030.04717.33
5.5.120.0030.03717.47
5.5.110.0070.03717.11
5.5.100.0000.05317.26
5.5.90.0000.05017.23
5.5.80.0030.05717.37
5.5.70.0000.04017.10
5.5.60.0000.04717.49
5.5.50.0030.06717.40
5.5.40.0030.04017.37
5.5.30.0070.04017.33
5.5.20.0030.08317.49
5.5.10.0100.08017.39
5.5.00.0000.06717.08
5.4.450.0170.08019.33
5.4.440.0000.09719.25
5.4.430.0030.09019.32
5.4.420.0070.06319.34
5.4.410.0100.08319.31
5.4.400.0100.04719.08
5.4.390.0030.04319.12
5.4.380.0100.03719.16
5.4.370.0000.05019.03
5.4.360.0030.05319.12
5.4.350.0000.04719.00
5.4.340.0030.04318.98
5.4.320.0000.04719.00
5.4.310.0030.04319.08
5.4.300.0000.04318.98
5.4.290.0000.05019.02
5.4.280.0030.04719.00
5.4.270.0000.04719.16
5.4.260.0000.04018.96
5.4.250.0030.03319.16
5.4.240.0030.04319.18
5.4.230.0030.04719.02
5.4.220.0000.04718.94
5.4.210.0070.04019.00
5.4.200.0000.04019.11
5.4.190.0030.08318.94
5.4.180.0070.09319.26
5.4.170.0000.08318.94
5.4.160.0100.08019.05
5.4.150.0070.08719.09
5.4.140.0130.05316.54
5.4.130.0130.07316.25
5.4.120.0030.08316.56
5.4.110.0000.08316.49
5.4.100.0100.08016.51
5.4.90.0030.07316.40
5.4.80.0030.06016.51
5.4.70.0100.08016.39
5.4.60.0030.08716.21
5.4.50.0130.03716.46
5.4.40.0030.05716.55
5.4.30.0030.07716.49
5.4.20.0030.09016.40
5.4.10.0030.07316.36
5.4.00.0000.09015.70
5.3.290.0100.03314.53
5.3.280.0030.04314.40
5.3.270.0100.08014.72
5.3.260.0070.09014.56
5.3.250.0270.05314.56
5.3.240.0000.06314.56
5.3.230.0170.09314.68
5.3.220.0000.08314.66
5.3.210.0100.08314.51
5.3.200.0070.06014.64
5.3.190.0100.07014.65
5.3.180.0070.05714.57
5.3.170.0000.09014.36
5.3.160.0070.05014.44
5.3.150.0000.08014.40
5.3.140.0100.06014.42
5.3.130.0070.07014.41
5.3.120.0070.08714.45
5.3.110.0100.08014.49
5.3.100.0130.08014.06
5.3.90.0100.06013.86
5.3.80.0100.08714.10
5.3.70.0170.07313.93
5.3.60.0130.06713.90
5.3.50.0100.08313.88
5.3.40.0100.07713.98
5.3.30.0070.06013.81
5.3.20.0070.07713.59
5.3.10.0030.04713.61
5.3.00.0070.05013.58
5.2.170.0070.07011.10
5.2.160.0000.06711.31
5.2.150.0130.06011.07
5.2.140.0030.07711.11
5.2.130.0070.03711.00
5.2.120.0070.06011.27
5.2.110.0000.06311.01
5.2.100.0070.07311.03
5.2.90.0030.07711.11
5.2.80.0070.07311.05
5.2.70.0100.06311.06
5.2.60.0030.07711.15
5.2.50.0070.07310.94
5.2.40.0030.06711.16
5.2.30.0030.07010.93
5.2.20.0100.06710.98
5.2.10.0070.07310.90
5.2.00.0070.07010.88
5.1.60.0070.0739.98
5.1.50.0070.0739.97
5.1.40.0070.04710.04
5.1.30.0130.06710.34
5.1.20.0000.07710.36
5.1.10.0070.0609.87
5.1.00.0100.05710.05
5.0.50.0070.0809.76
5.0.40.0030.0779.76
5.0.30.0100.0879.76
5.0.20.0030.0539.76
5.0.10.0030.0709.76
5.0.00.0070.0709.76
4.4.90.0000.0809.76
4.4.80.0030.0779.76
4.4.70.0030.0779.76
4.4.60.0000.0809.76
4.4.50.0000.0809.76
4.4.40.0030.0909.76
4.4.30.0030.0739.76
4.4.20.0030.0739.76
4.4.10.0000.0779.76
4.4.00.0030.0909.76
4.3.110.0030.0609.76
4.3.100.0030.0739.76
4.3.90.0000.0779.76
4.3.80.0070.0839.76
4.3.70.0000.0779.76
4.3.60.0030.0709.76
4.3.50.0000.0579.76
4.3.40.0070.0909.76
4.3.30.0030.0709.76
4.3.20.0000.0809.76
4.3.10.0030.0739.76
4.3.00.0030.0609.76

preferences:
38.32 ms | 401 KiB | 5 Q