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<100.00; $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<100.00; $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<100.00; $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.4.10.0070.01416.32
7.4.00.0100.01016.59
7.3.130.0030.01416.37
7.3.120.0070.00716.23
7.3.110.0030.01316.41
7.3.100.0090.00616.51
7.3.90.0000.01416.33
7.3.80.0030.01316.42
7.3.70.0070.00716.36
7.3.60.0040.00816.30
7.3.50.0070.01116.23
7.3.40.0060.00916.35
7.3.30.0070.01016.40
7.3.20.0030.00918.13
7.3.10.0110.00617.54
7.3.00.0110.00517.34
7.2.260.0030.01616.79
7.2.250.0040.01416.51
7.2.240.0030.01416.69
7.2.230.0000.01416.77
7.2.220.0040.01116.71
7.2.210.0060.01016.51
7.2.200.0040.00816.66
7.2.190.0080.00816.49
7.2.180.0100.00716.65
7.2.170.0000.01116.54
7.2.160.0070.01016.58
7.2.150.0070.01018.46
7.2.140.0030.01318.42
7.2.130.0080.00817.68
7.2.120.0050.00917.64
7.2.110.0100.00617.74
7.2.100.0040.01017.73
7.2.90.0030.01317.72
7.2.80.0050.01217.59
7.2.70.0050.00817.58
7.2.60.0030.01217.68
7.2.50.0070.00817.65
7.2.40.0070.00717.51
7.2.30.0060.00817.74
7.2.20.0050.00817.73
7.2.10.0050.00817.73
7.2.00.0060.01018.26
7.1.330.0060.00617.48
7.1.320.0040.01117.46
7.1.310.0070.01117.33
7.1.300.0040.00817.10
7.1.290.0040.01117.32
7.1.280.0030.01417.36
7.1.270.0000.01517.43
7.1.260.0030.01417.24
7.1.250.0100.00516.47
7.1.240.0000.01117.32
7.1.230.0000.01217.34
7.1.220.0000.01017.22
7.1.210.0090.00617.28
7.1.200.0060.00917.25
7.1.190.0040.01517.32
7.1.180.0070.00717.03
7.1.170.0090.00617.11
7.1.160.0070.01017.19
7.1.150.0040.01117.15
7.1.140.0130.00317.34
7.1.130.0030.00717.28
7.1.120.0040.01417.21
7.1.110.0060.00917.36
7.1.100.0030.01017.38
7.1.90.0040.01417.24
7.1.80.0030.01017.33
7.1.70.0050.00517.14
7.1.60.0090.01018.32
7.1.50.0050.01016.82
7.1.40.0030.01217.19
7.1.30.0000.01517.46
7.1.20.0040.01217.36
7.1.10.0030.01317.17
7.1.00.0070.04219.87
7.0.330.0030.00616.91
7.0.320.0000.01116.95
7.0.310.0070.00716.95
7.0.300.0090.00617.05
7.0.290.0060.00917.02
7.0.280.0070.00716.94
7.0.270.0060.00917.07
7.0.260.0090.00616.88
7.0.250.0070.01017.11
7.0.240.0070.00716.93
7.0.230.0100.00616.88
7.0.220.0000.01317.09
7.0.210.0030.00917.07
7.0.200.0020.01116.98
7.0.190.0080.00317.05
7.0.180.0050.00517.03
7.0.170.0080.00417.00
7.0.160.0040.01116.95
7.0.150.0070.01017.18
7.0.140.0050.04819.54
7.0.130.0060.00316.88
7.0.120.0030.01316.82
7.0.110.0030.01317.04
7.0.100.0070.00717.08
7.0.90.0060.00616.86
7.0.80.0060.00616.96
7.0.70.0100.00716.85
7.0.60.0020.02718.35
7.0.50.0110.03817.38
7.0.40.0090.02217.59
7.0.30.0170.04117.60
7.0.20.0120.03217.58
7.0.10.0070.02417.53
7.0.00.0020.02717.52
5.6.400.0060.00916.15
5.6.390.0000.01315.94
5.6.380.0060.00315.53
5.6.370.0030.01016.02
5.6.360.0040.01416.00
5.6.350.0070.01015.73
5.6.340.0100.00715.75
5.6.330.0140.00316.23
5.6.320.0030.01215.66
5.6.310.0070.00716.02
5.6.300.0060.00915.79
5.6.290.0090.00616.08
5.6.280.0020.04318.32
5.6.270.0030.00615.65
5.6.260.0120.00315.68
5.6.250.0030.01216.01
5.6.240.0070.00715.71
5.6.230.0120.00316.00
5.6.220.0000.01616.01
5.6.210.0050.04618.14
5.6.200.0120.03016.89
5.6.190.0060.03118.13
5.6.180.0000.05418.03
5.6.170.0130.03518.13
5.6.160.0080.04718.16
5.6.150.0050.04817.00
5.6.140.0070.03516.98
5.6.130.0070.04616.88
5.6.120.0050.04918.43
5.6.110.0080.04518.55
5.6.100.0100.04118.48
5.6.90.0020.03618.37
5.6.80.0100.04218.21
5.6.70.0100.00315.80
5.6.60.0090.00615.70
5.6.50.0100.00315.86
5.6.40.0090.00615.81
5.6.30.0070.01015.86
5.6.20.0050.00515.89
5.6.10.0120.00415.92
5.6.00.0070.00315.84
5.5.380.0030.00715.62
5.5.370.0030.01315.89
5.5.360.0080.00815.61
5.5.350.0080.03018.07
5.5.340.0050.04416.79
5.5.330.0030.02618.16
5.5.320.0000.02818.09
5.5.310.0140.02618.00
5.5.300.0110.03816.93
5.5.290.0080.04616.74
5.5.280.0110.04218.21
5.5.270.0060.02518.19
5.5.260.0010.04118.26
5.5.250.0000.02818.14
5.5.240.0020.04817.88
5.5.230.0040.01215.90
5.5.220.0030.01315.87
5.5.210.0030.01215.75
5.5.200.0070.00315.84
5.5.190.0070.01015.80
5.5.180.0060.01215.66
5.5.170.0030.01415.38
5.5.160.0060.01215.59
5.5.150.0120.00415.58
5.5.140.0030.01315.90
5.5.130.0040.01115.68
5.5.120.0030.01315.66
5.5.110.0000.01515.86
5.5.100.0000.01715.84
5.5.90.0030.00915.49
5.5.80.0040.01415.63
5.5.70.0060.00915.61
5.5.60.0090.00915.76
5.5.50.0090.00615.53
5.5.40.0100.00315.90
5.5.30.0070.00415.80
5.5.20.0090.00915.84
5.5.10.0070.00715.60
5.5.00.0070.01015.87
5.4.450.0200.02316.11
5.4.440.0350.02316.03
5.4.430.0250.01816.02
5.4.420.0240.02315.83
5.4.410.0340.02515.96
5.4.400.0200.03315.40
5.4.390.0300.03715.40
5.4.380.0080.03215.39
5.4.370.0100.03315.52
5.4.360.0130.02815.50
5.4.350.0120.03215.65
5.4.340.0190.02315.59
5.4.330.0080.00412.50
5.4.320.0060.02312.55
5.4.310.0080.02412.50
5.4.300.0100.01912.49
5.4.290.0050.02512.56
5.4.280.0060.02312.35
5.4.270.0070.02112.44
5.4.260.0080.02312.37
5.4.250.0020.02712.50
5.4.240.0090.02012.30
5.4.230.0060.02712.43
5.4.220.0080.02112.30
5.4.210.0050.02112.36
5.4.200.0060.02412.48
5.4.190.0030.02412.38
5.4.180.0070.02012.38
5.4.170.0140.02312.36
5.4.160.0100.02712.29
5.4.150.0110.02612.31
5.4.140.0130.03812.29
5.4.130.0110.02612.14
5.4.120.0120.02512.13
5.4.110.0150.02012.28
5.4.100.0060.03012.18
5.4.90.0090.02812.25
5.4.80.0110.02512.20
5.4.70.0080.02612.28
5.4.60.0070.02712.16
5.4.50.0110.02312.24
5.4.40.0110.02412.31
5.4.30.0100.02412.21
5.4.20.0170.03412.27
5.4.10.0150.02212.21
5.4.00.0070.02911.88
5.3.290.0080.03012.93
5.3.280.0120.02212.75
5.3.270.0150.02712.80
5.3.260.0120.02812.86
5.3.250.0170.02512.88
5.3.240.0130.02712.75
5.3.230.0210.03412.87
5.3.220.0180.02512.71
5.3.210.0180.02212.74
5.3.200.0160.02812.85
5.3.190.0130.02912.73
5.3.180.0140.02912.81
5.3.170.0190.03912.78
5.3.160.0150.02912.82
5.3.150.0120.02712.76
5.3.140.0140.02512.77
5.3.130.0210.04612.73
5.3.120.0140.02312.82
5.3.110.0150.02412.74
5.3.100.0100.02912.56
5.3.90.0130.02512.57
5.3.80.0110.02412.41
5.3.70.0090.02812.44
5.3.60.0070.02712.48
5.3.50.0140.02512.42
5.3.40.0150.04112.38
5.3.30.0090.02712.48
5.3.20.0160.02212.29
5.3.10.0140.02712.20
5.3.00.0100.02812.12
5.2.170.0130.0369.20
5.2.160.0140.0329.20
5.2.150.0140.0349.20
5.2.140.0130.0359.20
5.2.130.0150.0349.16
5.2.120.0180.0299.16
5.2.110.0120.0359.16
5.2.100.0140.0329.16
5.2.90.0100.0379.15
5.2.80.0150.0329.15
5.2.70.0100.0379.15
5.2.60.0110.0369.11
5.2.50.0100.0379.07
5.2.40.0180.0299.05
5.2.30.0170.0299.02
5.2.20.0110.0369.02
5.2.10.0120.0359.00
5.2.00.0140.0318.84
5.1.60.0100.0298.11
5.1.50.0130.0278.11
5.1.40.0120.0308.09
5.1.30.0070.0358.43
5.1.20.0110.0328.46
5.1.10.0120.0328.19
5.1.00.0120.0348.19
5.0.50.0150.0216.67
5.0.40.0080.0246.53
5.0.30.0090.0356.34
5.0.20.0100.0226.32
5.0.10.0100.0216.30
5.0.00.0060.0386.30
4.4.90.0200.0354.78
4.4.80.0050.0204.75
4.4.70.0060.0204.76
4.4.60.0090.0174.75
4.4.50.0050.0204.77
4.4.40.0080.0274.70
4.4.30.0080.0174.75
4.4.20.0080.0174.84
4.4.10.0050.0204.85
4.4.00.0060.0294.76
4.3.110.0080.0174.67
4.3.100.0030.0214.66
4.3.90.0060.0184.63
4.3.80.0050.0304.61
4.3.70.0040.0214.63
4.3.60.0080.0164.63
4.3.50.0070.0174.63
4.3.40.0160.0484.55
4.3.30.0040.0213.36
4.3.20.0030.0203.34
4.3.10.0040.0193.30
4.3.00.0000.02012.89

preferences:
26.64 ms | 401 KiB | 5 Q