3v4l.org

run code in 300+ PHP versions simultaneously
<?php $starttime = microtime(true); $sArr = array(); for ($i = 0; $i < 300000; $i++) { $sArr[] = 'String concatenation. ' . $i; } $str = implode('', $sArr); $x = md5($str); $endtime = microtime(true); print "array append & implode: " . ($endtime - $starttime) . " s\n" ; // standard string append $starttime = microtime(true); $str = ''; for ($i = 0; $i < 300000; $i++) { $str .= 'String concatenation. ' . $i; } $x = md5($str); unset($str); $endtime = microtime(true); print "string concat: " . ($endtime - $starttime) . " s\n" ; $starttime = microtime(true); $sArr = array(); for ($i = 0; $i < 300000; $i++) { $sArr[] = 'String concatenation. ' . $i; } $str = implode('', $sArr); $x = md5($str); $endtime = microtime(true); print "array append & implode: " . ($endtime - $starttime) . " s\n" ;

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.0700.23653.64
7.3.120.0630.24053.92
7.3.110.0630.16853.63
7.3.100.0660.17853.45
7.3.90.0870.15153.27
7.3.80.0630.22053.97
7.3.70.0490.15853.73
7.3.60.0440.20153.74
7.3.50.0560.17853.55
7.3.40.0470.16453.53
7.3.30.0330.17653.34
7.3.20.0130.17354.98
7.3.10.0430.14854.87
7.3.00.0200.16554.82
7.2.250.0730.25653.68
7.2.240.0690.19853.75
7.2.230.0500.18953.76
7.2.220.0340.18853.70
7.2.210.0500.17953.59
7.2.200.0460.20253.56
7.2.190.0440.18553.61
7.2.180.0530.21853.25
7.2.170.0370.19053.63
7.2.00.0130.12657.16
7.1.330.0300.21953.90
7.1.320.0170.20953.80
7.1.310.0230.27153.65
7.1.300.0390.18853.80
7.1.290.0300.24053.85
7.1.280.0230.21253.76
7.1.270.0320.19853.61
7.1.260.0430.19753.75
7.1.70.0200.13155.04
7.1.60.0170.19655.44
7.1.50.0100.13155.27
7.1.00.0230.22360.27
7.0.200.2600.15354.71
7.0.140.0300.20360.21
7.0.100.1470.22058.53
7.0.90.0670.22058.63
7.0.80.0970.20358.53
7.0.70.0970.18058.50
7.0.60.0730.19758.38
7.0.50.0700.21358.98
7.0.40.0600.23741.21
7.0.30.0500.16741.16
7.0.20.0430.15341.21
7.0.10.0430.23341.26
7.0.00.0670.20041.13
5.6.280.0170.18785.02
5.6.250.0170.18784.86
5.6.240.0330.15784.78
5.6.230.0470.19384.95
5.6.220.0330.14384.84
5.6.210.0400.15784.84
5.6.200.0400.16785.26
5.6.190.0270.14085.15
5.6.180.0400.15785.21
5.6.170.0200.15785.26
5.6.160.0370.15085.30
5.6.150.0170.12085.37
5.6.140.0270.17785.17
5.6.130.0270.10785.30
5.6.120.0470.16085.21
5.6.110.0370.13785.27
5.6.100.0300.12785.22
5.6.90.0330.16785.31
5.6.80.0200.16084.66
5.6.70.0270.16784.60
5.6.60.0400.17084.48
5.6.50.0230.16784.75
5.6.40.0170.16784.59
5.6.30.0270.14784.50
5.6.20.0370.14384.57
5.6.10.0370.15384.59
5.6.00.0330.15384.50
5.5.380.0330.20784.65
5.5.370.0270.14384.55
5.5.360.0470.14384.69
5.5.350.0400.12784.56
5.5.340.0370.16085.03
5.5.330.0130.17384.82
5.5.320.0070.17085.01
5.5.310.0300.15785.02
5.5.300.0270.14084.97
5.5.290.0300.16384.96
5.5.280.0230.17384.84
5.5.270.0300.20785.11
5.5.260.0370.16384.99
5.5.250.0330.17384.89
5.5.240.0200.16084.50
5.5.230.0170.16084.31
5.5.220.0200.16084.30
5.5.210.0300.15084.41
5.5.200.0230.16784.31
5.5.190.0400.09384.39
5.5.180.0270.17084.41
5.5.160.0270.15084.43
5.5.150.0170.11784.35
5.5.140.0270.17784.34
5.5.130.0270.15384.34
5.5.120.0270.16784.32
5.5.110.0370.14384.34
5.5.100.0270.16084.24
5.5.90.0130.17084.24
5.5.80.0200.17384.32
5.5.70.0300.16384.23
5.5.60.0370.10084.30
5.5.50.0230.16384.31
5.5.40.0470.15384.27
5.5.30.0470.15084.09
5.5.20.0500.18784.24
5.5.10.0230.15784.25
5.5.00.0230.18384.17
5.4.450.0330.17083.46
5.4.440.0330.16083.57
5.4.430.0370.15783.57
5.4.420.0370.16383.45
5.4.410.0330.15383.38
5.4.400.0270.18083.23
5.4.390.0400.14783.07
5.4.380.0230.12383.24
5.4.370.0370.11383.09
5.4.360.0370.17383.18
5.4.350.0330.16082.95
5.4.340.0370.14083.12
5.4.320.0170.11083.09
5.4.310.0370.14083.10
5.4.300.0270.15083.17
5.4.290.0300.12083.12
5.4.280.0330.15783.13
5.4.270.0200.14083.07
5.4.260.0270.15783.18
5.4.250.0300.13083.07
5.4.240.0200.10383.18
5.4.230.0300.16083.09
5.4.220.0330.12382.95
5.4.210.0270.14383.07
5.4.200.0170.12383.16
5.4.190.0200.10782.95
5.4.180.0370.17383.17
5.4.170.0300.10382.94
5.4.160.0130.15783.20
5.4.150.0330.14383.09
5.4.140.0270.18380.46
5.4.130.0070.14380.37
5.4.120.0530.13780.48
5.4.110.0130.18080.62
5.4.100.0230.16080.40
5.4.90.0300.09780.43
5.4.80.0230.10780.41
5.4.70.0330.12380.36
5.4.60.0130.16080.46
5.4.50.0300.09380.37
5.4.40.0330.14080.55
5.4.30.0330.08780.45
5.4.20.0170.18080.58
5.4.10.0230.16080.55
5.4.00.0300.15079.97
5.3.290.0300.15077.71
5.3.280.0330.16077.83
5.3.270.0170.14377.70
5.3.260.0200.16377.79
5.3.250.0270.14077.79
5.3.240.0230.13077.78
5.3.230.0330.09377.74
5.3.220.0270.17077.66
5.3.210.0170.11077.79
5.3.200.0270.14377.66
5.3.190.0270.16777.64
5.3.180.0230.12777.74
5.3.170.0300.13777.79
5.3.160.0230.16077.70
5.3.150.0170.17777.70
5.3.140.0370.16377.73
5.3.130.0230.10377.74
5.3.120.0200.17377.79
5.3.110.0270.15777.72
5.3.100.0370.15077.18
5.3.90.0170.17777.16
5.3.80.0230.18077.09
5.3.70.0270.15777.13
5.3.60.0270.11377.11
5.3.50.0200.15777.12
5.3.40.0170.12077.07
5.3.30.0430.08777.07
5.3.20.0330.11076.69
5.3.10.0270.16076.67
5.3.00.0130.10376.65
5.2.170.0570.407197.31
5.2.160.0400.34074.39
5.2.150.0400.30074.35
5.2.140.0130.31374.27
5.2.130.0370.26074.27
5.2.120.0300.27774.25
5.2.110.0230.37074.31
5.2.100.0200.34374.38
5.2.90.0500.367197.52
5.2.80.0130.30774.20
5.2.70.0430.343197.02
5.2.60.0730.340197.07
5.2.50.0370.30773.34
5.2.40.0200.35073.24
5.2.30.0230.38073.09
5.2.20.0270.40773.07
5.2.10.0200.37373.11
5.2.00.0430.36372.97
5.1.60.0500.540126.43
5.1.50.0430.490126.33
5.1.40.1000.477126.52
5.1.30.0500.533126.91
5.1.20.0470.503126.81
5.1.10.0630.487126.50
5.1.00.0400.533126.60
5.0.50.1200.563125.05
5.0.40.0430.717124.89
5.0.30.0230.673124.77
5.0.20.0370.587124.54
5.0.10.0370.657124.71
5.0.00.0430.613124.65
4.4.90.1470.587164.65
4.4.80.0370.607164.64
4.4.70.0700.683164.71
4.4.60.0730.683164.63
4.4.50.0430.707164.64
4.4.40.0430.710164.62
4.4.30.0570.677164.63
4.4.20.0500.653164.72
4.4.10.0630.663164.70
4.4.00.0300.723164.69
4.3.110.0670.643164.65
4.3.100.0430.693164.60
4.3.90.0530.693164.57
4.3.80.0600.710164.48
4.3.70.0430.747164.49
4.3.60.0700.697164.36
4.3.50.0500.587164.44
4.3.40.0530.697164.53
4.3.30.0570.647163.25
4.3.20.0770.680163.29
4.3.10.0500.607121.06
4.3.00.0530.623121.07

preferences:
33.54 ms | 400 KiB | 5 Q