3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo "Only strings: ", ob_start(); $i = 0; $time0 = microtime(1); while($i++ < 100000) echo'this is a test','this is a test','this is a test','this is a test','this is a test','this is a test'; $time1 = microtime(1); ob_end_clean(); echo "comma=", round($c=($time1-$time0)*1000, 3), "ms"; ob_start(); $i = 0; $time0 = microtime(1); while($i++ < 100000) echo'this is a test'.'this is a test'.'this is a test'.'this is a test'.'this is a test'.'this is a test'; $time1 = microtime(1); ob_end_clean(); echo ", dot=", round($d=($time1-$time0)*1000, 3), "ms"; echo ' > delta= ', round(($d - $c) * 100 / $d, 1), "%"; echo "\n"; echo "With vars: ", ob_start(); $i = 0; $time0 = microtime(1); while($i++ < 100000) echo'this is a test',$i,'this is a test',$i,'this is a test',$i; $time1 = microtime(1); ob_end_clean(); echo "comma=", round($c=($time1-$time0)*1000, 3), "ms"; ob_start(); $i = 0; $time0 = microtime(1); while($i++ < 100000) echo'this is a test'.$i.'this is a test'.$i.'this is a test'.$i; $time1 = microtime(1); ob_end_clean(); echo ", dot=", round($d=($time1-$time0)*1000, 3), "ms"; echo ' > delta= ', round(($d - $c) * 100 / $d, 1), "%"; echo "\n"; echo "With array: "; $A = array('a' => 'A', 'b' => 'B', 'c' => 'C'); ob_start(); $i = 0; $time0 = microtime(1); while($i++ < 100000) echo'this is a test',$A['a'],'this is a test',$A['b'],'this is a test',$A['c']; $time1 = microtime(1); ob_end_clean(); echo "comma=", round($c=($time1-$time0)*1000, 3), "ms"; ob_start(); $i = 0; $time0 = microtime(1); while($i++ < 100000) echo'this is a test'.$A['a'].'this is a test'.$A['b'].'this is a test'.$A['c']; $time1 = microtime(1); ob_end_clean(); echo ", dot=", round($d=($time1-$time0)*1000, 3), "ms"; echo ' > delta= ', round(($d - $c) * 100 / $d, 1), "%"; echo "\n"; echo "With array & function: "; $A = array('a' => 'A', 'b' => 'B', 'c' => 'C'); ob_start(); $i = 0; $time0 = microtime(1); while($i++ < 100000) echo'this is a test',ss($A['a']),'this is a test',ss($A['b']),'this is a test',ss($A['c']); $time1 = microtime(1); ob_end_clean(); echo "comma=", round($c=($time1-$time0)*1000, 3), "ms"; ob_start(); $i = 0; $time0 = microtime(1); while($i++ < 100000) echo'this is a test'.ss($A['a']).'this is a test'.ss($A['b']).'this is a test'.ss($A['c']); $time1 = microtime(1); ob_end_clean(); echo ", dot=", round($d=($time1-$time0)*1000, 3), "ms"; echo ' > delta= ', round(($d - $c) * 100 / $d, 1), "%"; function ss($s) { return substr($s, 0); }

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.0630.32730.27
7.4.00.0450.27730.02
7.3.130.0700.29230.20
7.3.120.0500.32430.01
7.3.110.0580.28730.04
7.3.100.0460.24730.15
7.3.90.0320.25130.01
7.3.80.0330.31530.42
7.3.70.0360.24029.96
7.3.60.0420.28430.15
7.3.50.0480.25129.98
7.3.40.0470.28729.85
7.3.30.0420.24130.04
7.3.20.0280.22730.51
7.3.10.0550.21930.40
7.3.00.0170.24830.68
7.2.260.0430.37730.52
7.2.250.0380.35330.28
7.2.240.0480.26930.31
7.2.230.0420.31830.53
7.2.220.0370.28930.28
7.2.210.0400.28630.27
7.2.200.0430.26430.31
7.2.190.0480.27830.40
7.2.180.0450.29530.53
7.2.170.0450.25030.37
7.2.160.0570.23530.06
7.2.150.0330.28630.85
7.2.140.0300.31130.61
7.2.130.0370.27730.91
7.2.120.0170.36630.66
7.2.110.0360.23730.96
7.2.100.0230.26030.95
7.2.90.0130.31130.82
7.2.80.0230.23830.88
7.2.70.0100.24930.63
7.2.60.0170.32631.04
7.2.50.0230.26530.70
7.2.40.0400.24730.98
7.2.30.0070.35330.99
7.2.20.0170.28230.68
7.2.10.0300.31130.79
7.2.00.0130.24932.12
7.1.330.0200.39429.82
7.1.320.0350.39429.79
7.1.310.0300.33929.56
7.1.300.0230.40229.73
7.1.290.0220.36129.75
7.1.280.0270.35029.53
7.1.270.0300.37729.55
7.1.260.0300.35229.87
7.1.250.0300.35029.48
7.1.240.0170.32529.58
7.1.230.0200.41529.59
7.1.220.0100.39129.77
7.1.210.0230.38829.55
7.1.200.0170.38229.72
7.1.190.0200.39929.65
7.1.180.0300.34029.45
7.1.170.0270.36129.40
7.1.160.0170.35829.83
7.1.150.0200.47729.76
7.1.140.0200.32329.59
7.1.130.0230.36029.63
7.1.120.0230.34729.68
7.1.110.0200.39429.80
7.1.100.0270.39329.64
7.1.90.0330.43729.67
7.1.80.0230.39329.76
7.1.70.0230.25330.25
7.1.60.0280.32530.54
7.1.50.0220.33130.29
7.1.40.0270.39529.69
7.1.30.0370.35129.51
7.1.20.0200.39429.48
7.1.10.0200.32229.86
7.1.00.0220.31732.89
7.0.330.0270.34529.42
7.0.320.0170.41729.36
7.0.310.0230.37029.20
7.0.300.0200.35729.11
7.0.290.0300.35829.16
7.0.280.0230.45829.49
7.0.270.0360.41429.27
7.0.260.0170.40329.07
7.0.250.0200.36329.55
7.0.240.0300.42029.27
7.0.230.0300.36129.38
7.0.220.0170.38329.48
7.0.210.0270.44029.45
7.0.200.0540.27330.13
7.0.190.0300.43729.41
7.0.180.0330.39329.41
7.0.170.0170.35729.50
7.0.160.0070.37529.23
7.0.150.0270.41329.53
7.0.140.0180.37532.80
7.0.130.0130.38729.29
7.0.120.0070.42529.56
7.0.110.0130.37229.36
7.0.100.0130.34129.52
7.0.90.1450.40232.42
7.0.80.1320.31532.22
7.0.70.0930.33632.41
7.0.60.1580.35532.34
7.0.50.1200.34732.64
7.0.40.0820.37528.75
7.0.30.0830.33328.62
7.0.20.0950.36328.74
7.0.10.0450.35628.82
7.0.00.1050.36128.60
5.6.400.0230.65922.80
5.6.390.0170.66922.56
5.6.380.0260.60522.72
5.6.370.0230.69422.45
5.6.360.0070.67822.66
5.6.350.0070.73222.69
5.6.340.0100.67422.70
5.6.330.0100.59822.32
5.6.320.0130.54922.72
5.6.310.0200.65122.81
5.6.300.0100.59722.82
5.6.290.0100.76822.84
5.6.280.0120.58326.09
5.6.270.0100.80022.63
5.6.260.0100.69122.72
5.6.250.0130.60022.50
5.6.240.0030.81022.52
5.6.230.0170.63325.82
5.6.220.0080.50225.73
5.6.210.0380.58291.50
5.6.200.0170.52126.05
5.6.190.0120.47125.96
5.6.180.0370.56191.71
5.6.170.0070.49325.94
5.6.160.0130.50525.90
5.6.150.0170.52725.98
5.6.140.0130.52426.02
5.6.130.0130.56326.09
5.6.120.0070.60925.96
5.6.110.0120.53425.98
5.6.100.0150.57326.13
5.6.90.0100.49725.89
5.6.80.0080.55725.73
5.6.70.0130.47225.64
5.6.60.0100.51225.50
5.6.50.0120.53125.76
5.6.40.0080.57125.60
5.6.30.0030.51725.64
5.6.20.0330.57191.36
5.6.10.0200.55425.52
5.6.00.0150.56325.58
5.5.380.0000.61322.20
5.5.370.0030.55325.66
5.5.360.0080.57825.79
5.5.350.0070.54325.54
5.5.340.0180.57125.66
5.5.330.0070.50525.66
5.5.320.0180.58426.01
5.5.310.0130.51025.97
5.5.300.0420.47925.82
5.5.290.0120.51625.95
5.5.280.0150.55526.00
5.5.270.0070.57225.68
5.5.260.0080.55125.82
5.5.250.0080.56325.57
5.5.240.0080.50125.39
5.5.230.0120.50325.35
5.5.220.0130.49925.50
5.5.210.0120.53825.45
5.5.200.0100.57125.64
5.5.190.0100.49025.39
5.5.180.0150.57625.34
5.5.170.0170.61122.40
5.5.160.0200.52525.35
5.5.150.0100.49325.48
5.5.140.0120.51225.47
5.5.130.0120.55825.46
5.5.120.0080.52225.37
5.5.110.0100.50725.55
5.5.100.0280.53590.78
5.5.90.0170.57925.25
5.5.80.0100.58425.54
5.5.70.0120.49225.25
5.5.60.0100.56125.42
5.5.50.0120.59625.33
5.5.40.0220.53025.54
5.5.30.0120.56125.42
5.5.20.0230.49425.33
5.5.10.0070.56425.28
5.5.00.0170.51125.48
5.4.450.0100.56623.51
5.4.440.0150.55423.51
5.4.430.0150.52223.47
5.4.420.0100.54223.50
5.4.410.0120.60023.41
5.4.400.0080.46723.39
5.4.390.0200.52589.03
5.4.380.0170.47523.33
5.4.370.0150.53123.32
5.4.360.0050.45922.99
5.4.350.0080.52023.17
5.4.340.0100.57423.11
5.4.330.0070.76319.26
5.4.320.0130.53023.20
5.4.310.0170.55023.33
5.4.300.0150.52623.26
5.4.290.0070.57523.12
5.4.280.0100.48823.38
5.4.270.0120.54523.18
5.4.260.0070.53523.26
5.4.250.0120.58423.30
5.4.240.0130.59823.28
5.4.230.0120.53123.05
5.4.220.0150.56223.19
5.4.210.0080.51923.24
5.4.200.0130.52723.23
5.4.190.0070.52523.23
5.4.180.0100.52922.94
5.4.170.0150.54923.01
5.4.160.0130.56623.21
5.4.150.0030.51823.22
5.4.140.0100.55721.80
5.4.130.0270.56387.83
5.4.120.0070.48721.80
5.4.110.0130.49321.90
5.4.100.0120.54621.96
5.4.90.0260.48721.91
5.4.80.0170.51221.99
5.4.70.0080.57922.01
5.4.60.0100.55622.00
5.4.50.0120.56521.93
5.4.40.0250.50821.94
5.4.30.0150.50221.83
5.4.20.0160.53221.74
5.4.10.0150.53821.78
5.4.00.0130.56921.59
5.3.290.0180.60220.82
5.3.280.0100.54120.76
5.3.270.0080.58220.68
5.3.260.0070.58520.81
5.3.250.0050.57120.83
5.3.240.0130.58620.72
5.3.230.0120.58920.66
5.3.220.0120.57520.59
5.3.210.0150.55520.79
5.3.200.0120.58520.61
5.3.190.0100.55420.84
5.3.180.0150.54520.84
5.3.170.0110.58420.85
5.3.160.0050.52520.69
5.3.150.0050.59120.72
5.3.140.0100.54820.67
5.3.130.0150.57220.78
5.3.120.0070.53720.66
5.3.110.0170.56320.78
5.3.100.0070.61720.37
5.3.90.0070.60520.58
5.3.80.0170.59520.41
5.3.70.0320.61286.22
5.3.60.0170.65220.52
5.3.50.0100.59620.49
5.3.40.0630.54520.35
5.3.30.0120.56520.30
5.3.20.0120.59320.12
5.3.10.0060.51520.12
5.3.00.0080.54220.06
5.2.170.0100.44719.47
5.2.160.0100.48719.43
5.2.150.0470.38719.47
5.2.140.0400.42019.45
5.2.130.0100.47719.50
5.2.120.0170.47719.39
5.2.110.0130.42019.38
5.2.100.0030.42719.30
5.2.90.0430.447151.35
5.2.80.0030.47719.52
5.2.70.0100.39719.50
5.2.60.0070.48019.48
5.2.50.0130.47719.52
5.2.40.0030.47019.43
5.2.30.0030.50319.37
5.2.20.0100.51719.38
5.2.10.0100.40719.12
5.2.00.0030.39319.16
5.1.60.0030.42717.86
5.1.50.0000.46317.88
5.1.40.0030.42018.38
5.1.30.0130.38018.42
5.1.20.0070.39018.72
5.1.10.0130.52318.16
5.1.00.0000.53718.06
5.0.50.1000.59016.50
5.0.40.0130.65716.36
5.0.30.0170.62316.32
5.0.20.0070.50716.23
5.0.10.0070.62716.13
5.0.00.0170.56016.33
4.4.90.0030.54713.95
4.4.80.0070.61014.04
4.4.70.0070.54013.96
4.4.60.0030.53013.98
4.4.50.0030.50314.01
4.4.40.0070.48313.98
4.4.30.0100.56313.94
4.4.20.0130.47313.96
4.4.10.0900.697244.88
4.4.00.0100.74714.05
4.3.110.0630.65313.98
4.3.100.0030.62013.93
4.3.90.0100.58313.95
4.3.80.0070.67713.85
4.3.70.0100.54713.82
4.3.60.0030.50313.91
4.3.50.0070.52013.86
4.3.40.0670.46313.89
4.3.30.0070.56313.68
4.3.20.0070.61013.68
4.3.10.0030.59313.68
4.3.00.0070.59013.68

preferences:
40.13 ms | 401 KiB | 5 Q