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; print_r( $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.00.0090.01015.02
7.3.120.0110.00714.93
7.3.110.0070.01014.93
7.3.100.0090.00614.95
7.3.90.0030.01014.92
7.3.80.0120.00314.85
7.3.70.0060.00614.88
7.3.60.0130.00714.92
7.3.50.0030.00614.69
7.3.40.0000.01514.91
7.3.30.0070.00314.92
7.3.20.0110.00416.67
7.3.10.0130.00316.57
7.3.00.0070.00716.77
7.2.250.0030.01715.32
7.2.240.0040.01514.97
7.2.230.0000.01415.20
7.2.220.0040.01515.01
7.2.210.0000.01515.08
7.2.200.0070.01014.95
7.2.190.0040.00815.12
7.2.180.0070.00715.13
7.2.170.0120.00614.96
7.2.00.0070.00718.88
7.1.330.0140.00015.75
7.1.320.0070.00715.54
7.1.310.0040.00715.60
7.1.300.0000.00915.73
7.1.290.0070.01115.73
7.1.280.0060.00315.71
7.1.270.0030.00715.88
7.1.260.0080.00615.79
7.1.70.0030.00517.33
7.1.60.0070.01419.40
7.1.50.0000.02116.98
7.1.00.0030.06322.32
7.0.200.0000.00916.46
7.0.140.0030.07322.08
7.0.70.0070.05321.73
7.0.60.0070.06321.68
7.0.50.0070.08022.09
7.0.40.0030.08720.13
7.0.30.0070.05720.10
7.0.20.0100.07320.11
7.0.10.0100.07320.10
7.0.00.0100.06020.12
5.6.210.0000.07720.63
5.6.200.0030.06021.02
5.6.190.0070.06721.04
5.6.180.0070.08321.09
5.6.170.0000.09021.02
5.6.160.0070.04020.96
5.6.150.0030.07321.02
5.6.140.0000.08321.09
5.6.130.0130.07721.11
5.6.120.0100.05721.11
5.6.110.0070.08020.95
5.6.100.0030.06721.05
5.6.90.0100.08020.96
5.6.80.0030.07720.34
5.6.70.0070.06320.48
5.6.60.0070.06720.41
5.6.50.0030.05320.50
5.6.40.0000.04320.31
5.6.30.0030.04720.47
5.6.20.0070.04320.46
5.6.10.0070.03720.43
5.6.00.0030.08020.38
5.5.350.0100.07320.29
5.5.340.0070.07020.74
5.5.330.0000.08720.83
5.5.320.0030.08020.91
5.5.310.0000.08320.76
5.5.300.0070.07720.88
5.5.290.0070.07020.87
5.5.280.0030.08720.87
5.5.270.0030.07720.83
5.5.260.0030.07720.86
5.5.250.0130.05020.70
5.5.240.0070.07720.19
5.5.230.0070.07320.27
5.5.220.0070.07720.28
5.5.210.0070.04320.25
5.5.200.0000.08020.25
5.5.190.0000.08320.12
5.5.180.0000.06320.09
5.5.160.0030.07720.00
5.5.150.0000.05020.24
5.5.140.0030.06720.00
5.5.130.0000.08320.23
5.5.120.0030.06720.21
5.5.110.0070.06020.23
5.5.100.0130.07020.02
5.5.90.0100.07020.09
5.5.80.0070.06720.07
5.5.70.0100.07020.09
5.5.60.0130.07320.06
5.5.50.0130.06320.06
5.5.40.0000.06020.05
5.5.30.0130.06320.16
5.5.20.0070.05720.11
5.5.10.0030.07019.96
5.5.00.0000.07720.04
5.4.450.0070.06019.40
5.4.440.0030.06319.27
5.4.430.0000.07719.26
5.4.420.0030.07719.44
5.4.410.0070.07319.38
5.4.400.0100.07319.04
5.4.390.0070.07318.99
5.4.380.0070.03719.03
5.4.370.0030.05019.12
5.4.360.0000.07718.90
5.4.350.0000.07718.79
5.4.340.0000.08018.81
5.4.320.0030.08319.20
5.4.310.0030.05719.09
5.4.300.0070.03719.05
5.4.290.0030.04019.05
5.4.280.0070.06718.89
5.4.270.0030.07319.11
5.4.260.0000.07019.02
5.4.250.0030.06319.02
5.4.240.0070.06019.02
5.4.230.0100.05319.09
5.4.220.0030.08018.80
5.4.210.0000.07719.12
5.4.200.0030.05019.05
5.4.190.0030.05018.97
5.4.180.0000.06318.93
5.4.170.0030.07318.80
5.4.160.0030.07319.07
5.4.150.0000.06318.79
5.4.140.0030.07016.24
5.4.130.0000.04316.31
5.4.120.0070.05716.23
5.4.110.0070.07716.36
5.4.100.0000.04716.24
5.4.90.0030.03716.33
5.4.80.0070.05716.39
5.4.70.0000.06016.43
5.4.60.0000.03716.39
5.4.50.0030.05016.18
5.4.40.0030.05316.46
5.4.30.0000.03716.18
5.4.20.0030.04316.38
5.4.10.0000.04716.39
5.4.00.0030.04315.73
5.3.290.0000.08314.65
5.3.280.0070.06714.44
5.3.270.0030.05714.58
5.3.260.0070.08014.61
5.3.250.0000.06714.62
5.3.240.0030.07014.63
5.3.230.0000.07714.55
5.3.220.0000.07714.51
5.3.210.0000.07714.58
5.3.200.0030.04314.54
5.3.190.0000.05714.56
5.3.180.0000.04314.41
5.3.170.0000.05014.52
5.3.160.0070.04314.53
5.3.150.0000.04014.57
5.3.140.0030.04714.43
5.3.130.0030.03714.42
5.3.120.0000.04014.41
5.3.110.0000.05314.54
5.3.100.0030.07713.90
5.3.90.0070.07314.02
5.3.80.0070.06014.02
5.3.70.0070.06714.03
5.3.60.0000.05013.87
5.3.50.0000.06013.95
5.3.40.0070.05713.95
5.3.30.0030.06313.94
5.3.20.0030.07313.70
5.3.10.0070.06013.62
5.3.00.0000.07313.64
5.2.170.0070.06011.08
5.2.160.0030.05311.22
5.2.150.0000.06310.95
5.2.140.0000.05711.20
5.2.130.0070.05710.98
5.2.120.0000.06710.93
5.2.110.0000.06011.10
5.2.100.0030.03710.95
5.2.90.0070.06310.97
5.2.80.0070.05711.10
5.2.70.0000.06711.14
5.2.60.0000.06011.04
5.2.50.0070.04710.97
5.2.40.0030.03311.00
5.2.30.0030.06010.85
5.2.20.0070.05010.97
5.2.10.0100.05010.79
5.2.00.0000.06310.66
5.1.60.0070.0339.95
5.1.50.0030.05010.15
5.1.40.0030.04710.01
5.1.30.0030.05310.29
5.1.20.0030.05710.40
5.1.10.0000.05710.22
5.1.00.0030.05310.10
5.0.50.0030.0378.55
5.0.40.0000.0408.48
5.0.30.0000.0338.29
5.0.20.0000.0278.26
5.0.10.0030.0338.30
5.0.00.0000.0508.26
4.4.90.0000.0378.26
4.4.80.0000.0378.26
4.4.70.0000.0378.26
4.4.60.0000.0408.26
4.4.50.0000.0378.26
4.4.40.0000.0438.26
4.4.30.0070.0278.26
4.4.20.0000.0208.26
4.4.10.0000.0378.26
4.4.00.0000.0378.26
4.3.110.0000.0178.26
4.3.100.0070.0108.26
4.3.90.0000.0238.26
4.3.80.0000.0378.26
4.3.70.0030.0208.26
4.3.60.0070.0208.26
4.3.50.0000.0338.26
4.3.40.0070.0478.26
4.3.30.0030.0278.26
4.3.20.0000.0378.26
4.3.10.0000.0378.26
4.3.00.0000.0208.26

preferences:
28.65 ms | 401 KiB | 5 Q