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; var_dump($results);

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.0100.66814.92
7.3.120.0080.72314.80
7.3.110.0080.68614.62
7.3.100.0050.70314.88
7.3.90.0000.67214.80
7.3.80.0030.72514.70
7.3.70.0030.63614.52
7.3.60.0080.63814.64
7.3.50.0050.73714.50
7.3.40.0080.62214.65
7.3.30.0080.60314.74
7.3.20.0030.65116.58
7.3.10.0070.56516.61
7.3.00.0060.55616.63
7.2.250.0050.84215.14
7.2.240.0080.63315.25
7.2.230.0070.79814.99
7.2.220.0050.71215.06
7.2.210.0020.74715.22
7.2.200.0020.63215.16
7.2.190.0000.76714.94
7.2.180.0030.66215.05
7.2.170.0050.78315.11
7.2.160.0000.62314.92
7.2.150.0030.85016.73
7.2.140.0030.77216.80
7.2.130.0040.67317.01
7.2.120.0080.64716.98
7.2.110.0060.65816.88
7.2.100.0060.71316.88
7.2.90.0040.69716.92
7.2.80.0070.66916.79
7.2.70.0040.66616.89
7.2.60.0040.66516.85
7.2.50.0020.64717.00
7.2.40.0060.64416.96
7.2.30.0040.61016.98
7.2.20.0040.65416.76
7.2.10.0070.67416.96
7.2.00.0070.58917.49
7.1.330.0070.90415.67
7.1.320.0050.79215.79
7.1.310.0070.82515.63
7.1.300.0070.93115.88
7.1.290.0050.88215.70
7.1.280.0020.90115.80
7.1.270.0030.89415.72
7.1.260.0050.74515.73
7.1.250.0030.81115.78
7.1.240.0100.88015.58
7.1.230.0030.86615.70
7.1.220.0000.74015.68
7.1.210.0000.92015.78
7.1.200.0000.85815.67
7.1.190.0030.91115.89
7.1.180.0070.92815.62
7.1.170.0100.91015.53
7.1.160.0000.89515.38
7.1.150.0130.85615.75
7.1.140.0070.74915.86
7.1.130.0070.86615.68
7.1.120.0100.98015.60
7.1.110.0030.79215.85
7.1.100.0030.93215.80
7.1.90.0070.87815.58
7.1.80.0070.80315.93
7.1.70.0030.56316.49
7.1.60.0030.57817.43
7.1.50.0120.67616.48
7.1.40.0100.94815.84
7.1.30.0000.93015.47
7.1.20.0000.97115.55
7.1.10.0030.77515.28
7.1.00.0080.66618.90
7.0.330.0030.75615.15
7.0.320.0030.77715.21
7.0.310.0100.92014.92
7.0.300.0000.93015.21
7.0.290.0000.96315.48
7.0.280.0000.96615.27
7.0.270.0030.79515.29
7.0.260.0070.95115.33
7.0.250.0030.84015.34
7.0.240.0030.97515.15
7.0.230.0030.96615.31
7.0.220.0030.79715.22
7.0.210.0000.87315.22
7.0.200.0100.67115.10
7.0.190.0030.78315.55
7.0.180.0070.96515.41
7.0.170.0030.88215.43
7.0.160.0100.89015.44
7.0.150.0070.89815.20
7.0.140.0050.70218.63
7.0.130.0030.96915.45
7.0.120.0050.72018.68
7.0.110.0070.93015.39
7.0.100.0070.84815.18
7.0.90.0030.98315.15
7.0.80.0220.63417.64
7.0.70.0330.68717.63
7.0.60.0300.59817.54
7.0.50.0020.62017.96
7.0.40.0080.65016.76
7.0.30.0300.59616.68
7.0.20.0080.61916.67
7.0.10.0020.69816.71
7.0.00.0050.66316.68
5.6.400.0031.42914.70
5.6.390.0071.58314.30
5.6.380.0001.70913.86
5.6.370.0071.36714.58
5.6.360.0001.61614.29
5.6.350.0071.42214.36
5.6.340.0001.56214.67
5.6.330.0001.61214.57
5.6.320.0031.57114.46
5.6.310.0071.63514.03
5.6.300.0071.63013.90
5.6.290.0001.41814.61
5.6.280.0031.30017.73
5.6.270.0031.58414.23
5.6.260.0031.48014.41
5.6.250.0031.68214.52
5.6.240.0101.71614.07
5.6.230.0081.06217.46
5.6.220.0101.23617.46
5.6.210.0151.15617.44
5.6.200.0071.24717.74
5.6.190.0031.24117.69
5.6.180.0051.11917.62
5.6.170.0021.20217.69
5.6.160.0031.15117.63
5.6.150.0081.12117.64
5.6.140.0071.05117.50
5.6.130.0031.23417.54
5.6.120.0101.07817.58
5.6.110.0021.08517.53
5.6.100.0071.18917.69
5.6.90.0081.11917.65
5.6.80.0121.26717.36
5.6.70.0020.97417.21
5.6.60.0051.12317.28
5.6.50.0051.12917.29
5.6.40.0081.21017.21
5.6.30.0071.13717.31
5.6.20.0071.08917.31
5.6.10.0021.09617.37
5.6.00.0031.22117.29
5.5.380.0001.71114.18
5.5.370.0101.22817.41
5.5.360.0081.24717.37
5.5.350.0071.20917.42
5.5.340.0051.16817.72
5.5.330.0031.14017.65
5.5.320.0121.30317.58
5.5.310.0081.08117.56
5.5.300.0071.14317.55
5.5.290.0031.21717.55
5.5.280.0101.19317.62
5.5.270.0031.22417.51
5.5.260.0051.18117.53
5.5.250.0051.25117.55
5.5.240.0001.23217.28
5.5.230.0021.20717.20
5.5.220.0051.19617.33
5.5.210.0051.26617.19
5.5.200.0031.26817.18
5.5.190.0051.18617.25
5.5.180.0071.07617.29
5.5.170.0031.72814.16
5.5.160.0031.25117.29
5.5.150.0051.24217.20
5.5.140.0001.27217.31
5.5.130.0111.23117.08
5.5.120.0071.07817.37
5.5.110.0081.25017.15
5.5.100.0051.06817.35
5.5.90.0031.13717.08
5.5.80.0021.17217.17
5.5.70.0071.22517.16
5.5.60.0081.07317.23
5.5.50.0451.23317.23
5.5.40.0071.22317.23
5.5.30.0121.22917.28
5.5.20.0021.07517.05
5.5.10.0071.13317.25
5.5.00.0081.11017.20
5.4.450.0031.22415.32
5.4.440.0001.23315.19
5.4.430.0051.07315.25
5.4.420.0071.25415.25
5.4.410.0051.24715.18
5.4.400.0031.07615.07
5.4.390.0101.17815.07
5.4.380.0031.06415.16
5.4.370.0051.19715.12
5.4.360.0071.20015.07
5.4.350.0081.08115.20
5.4.340.0031.06815.06
5.4.330.0001.43411.08
5.4.320.0021.14514.93
5.4.310.0131.19915.09
5.4.300.0081.05215.07
5.4.290.0121.23615.10
5.4.280.0081.25215.18
5.4.270.0081.20115.19
5.4.260.0101.04315.10
5.4.250.0031.00814.93
5.4.240.0071.17515.08
5.4.230.0031.18515.01
5.4.220.0001.13415.16
5.4.210.0051.06015.03
5.4.200.0051.25015.19
5.4.190.0081.23815.04
5.4.180.0071.04615.16
5.4.170.0081.22915.11
5.4.160.0031.26315.06
5.4.150.0071.26815.06
5.4.140.0051.06913.72
5.4.130.0081.22313.72
5.4.120.0051.09713.68
5.4.110.0051.14313.82
5.4.100.0031.18513.67
5.4.90.0031.20613.74
5.4.80.0031.23813.66
5.4.70.0051.17513.71
5.4.60.0320.95613.64
5.4.50.0031.23513.81
5.4.40.0071.24513.72
5.4.30.0031.21913.81
5.4.20.0071.12013.87
5.4.10.0071.04313.69
5.4.00.0031.16313.41
5.3.290.0051.33612.85
5.3.280.0081.32112.83
5.3.270.0021.06012.85
5.3.260.0031.22312.83
5.3.250.0051.34812.78
5.3.240.0051.29512.78
5.3.230.0021.29112.76
5.3.220.0001.27212.82
5.3.210.0031.35412.82
5.3.200.0051.28812.83
5.3.190.0021.12912.81
5.3.180.0071.25312.82
5.3.170.0031.25712.83
5.3.160.0021.09612.76
5.3.150.0081.32612.82
5.3.140.0451.26912.75
5.3.130.0021.13512.81
5.3.120.0031.23412.81
5.3.110.0051.28112.75
5.3.100.0031.27912.48
5.3.90.0051.12412.54
5.3.80.0031.18112.54
5.3.70.0071.28512.55
5.3.60.0031.07912.53
5.3.50.0031.28012.45
5.3.40.0031.17312.51
5.3.30.0031.25012.47
5.3.20.0031.16412.37
5.3.10.0021.19512.37
5.3.00.0101.15912.25
5.2.170.0100.90011.63
5.2.160.0000.92011.63
5.2.150.0000.90311.63
5.2.140.0030.96011.63
5.2.130.0100.91711.63
5.2.120.0100.97711.63
5.2.110.0070.90711.63
5.2.100.0070.93011.63
5.2.90.0071.01711.63
5.2.80.0070.92311.63
5.2.70.0070.90711.63
5.2.60.0030.82311.63
5.2.50.0000.81711.63
5.2.40.0030.81311.63
5.2.30.0630.75711.63
5.2.20.0070.85011.63
5.2.10.0031.04011.63
5.2.00.0031.04011.63
5.1.60.0031.22711.63
5.1.50.0201.15711.63
5.1.40.0030.97711.63
5.1.30.0031.18011.63
5.1.20.0001.18711.63
5.1.10.0001.23311.63
5.1.00.0071.29011.63
5.0.50.0072.27011.63
5.0.40.0002.28711.63
5.0.30.0032.13711.63
5.0.20.0002.18311.63
5.0.10.0031.94011.63
5.0.00.0032.11711.63
4.4.90.0002.37711.63
4.4.80.0002.34711.63
4.4.70.0072.41711.63
4.4.60.0002.13011.63
4.4.50.0002.06711.63
4.4.40.0002.38711.63
4.4.30.0002.29311.63
4.4.20.0002.09011.63
4.4.10.0102.4737.98
4.4.00.0032.12711.63
4.3.110.0002.35711.63
4.3.100.0072.35311.63
4.3.90.0002.09011.63
4.3.80.0072.34311.63
4.3.70.0072.39011.63
4.3.60.0032.35711.63
4.3.50.0072.25011.63
4.3.40.0032.33711.63
4.3.30.0032.48311.63
4.3.20.0002.29011.63
4.3.10.0001.93311.63
4.3.00.0032.09311.63

preferences:
42.23 ms | 401 KiB | 5 Q