3v4l.org

run code in 300+ PHP versions simultaneously
<?php $iterations = 500000; $name = 'Tom'; $date = '13/09/2009'; $t1 = microtime(true); for ($i = 0; $i < $iterations; $i++) { $str = sprintf('Hi %s, you last logged in on %s.', $name, $date); } $t2 = microtime(true); echo 'sprintf: ' . ($t2-$t1); echo "\n"; $t1 = microtime(true); for ($i = 0; $i < $iterations; $i++) { $str = 'Hi ' . $name . ', you last logged in on ' . $date; } $t2 = microtime(true); echo 'concat: ' . ($t2-$t1); echo "\n"; $t1 = microtime(true); for ($i = 0; $i < $iterations; $i++) { $str = "Hi $name, you last logged in on $date"; } $t2 = microtime(true); echo 'expansion: ' . ($t2-$t1); echo "\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.0100.28214.78
7.3.120.0100.24414.75
7.3.110.0080.28014.50
7.3.100.0030.24014.74
7.3.90.0020.22814.84
7.3.80.0050.19114.87
7.3.70.0080.20514.78
7.3.60.0070.20014.94
7.3.50.0030.20614.92
7.3.40.0080.22014.95
7.3.30.0020.21814.81
7.3.20.0130.21416.73
7.3.10.0070.20516.57
7.3.00.0120.19116.72
7.2.250.0100.25715.02
7.2.240.0130.28715.17
7.2.230.0050.22715.15
7.2.220.0070.25314.89
7.2.210.0030.22114.94
7.2.200.0120.20015.16
7.2.190.0070.20915.06
7.2.180.0050.23115.01
7.2.170.0050.24315.13
7.2.00.0000.14819.21
7.1.330.0050.31815.88
7.1.320.0050.30915.77
7.1.310.0050.31215.75
7.1.300.0030.31915.81
7.1.290.0070.31815.85
7.1.280.0030.29215.85
7.1.270.0080.31415.79
7.1.260.0050.27515.86
7.1.70.0130.12317.22
7.1.60.0070.18819.38
7.1.50.0100.16716.99
7.1.00.0000.24322.48
7.0.200.0030.12716.88
7.0.60.0070.17320.00
7.0.50.0000.15317.80
7.0.40.0000.16720.05
7.0.30.0400.17720.21
7.0.20.0170.16720.20
7.0.10.0070.18020.16
7.0.00.0030.18020.09
5.6.280.0030.23721.05
5.6.210.0030.25720.67
5.6.200.0100.28318.20
5.6.190.0130.24320.45
5.6.180.0300.28020.41
5.6.170.0270.27720.49
5.6.160.0070.32020.38
5.6.150.0100.35318.11
5.6.140.0130.30318.21
5.6.130.0070.28718.05
5.6.120.0100.27321.09
5.6.110.0130.30321.02
5.6.100.0070.28320.96
5.6.90.0170.31020.88
5.6.80.0100.29020.43
5.5.350.0030.31020.42
5.5.340.0070.31717.97
5.5.330.0130.27020.27
5.5.320.0530.27720.51
5.5.310.0130.24720.30
5.5.300.0070.33717.95
5.5.290.0070.32018.00
5.5.280.0030.24720.90
5.5.270.0000.26320.83
5.5.260.0030.30020.73
5.5.250.0100.27720.58
5.5.240.0000.30020.16
5.4.450.0070.26719.57
5.4.440.1200.47719.37
5.4.430.0970.46319.63
5.4.420.0130.39319.29
5.4.410.0100.39019.40
5.4.400.0100.38719.22
5.4.390.0170.37718.98
5.4.380.0170.43719.05
5.4.370.0200.39318.98
5.4.360.0200.37319.05
5.4.350.0030.38719.00
5.4.340.0200.38019.05
5.4.320.0070.41319.16
5.4.310.0170.37019.25
5.4.300.0100.38018.98
5.4.290.0100.37319.12
5.4.280.0030.40319.14
5.4.270.0030.38018.95
5.4.260.0070.40719.05
5.4.250.0100.40019.11
5.4.240.0100.39019.14
5.4.230.0070.39719.25
5.4.220.0070.39319.14
5.4.210.0100.40719.16
5.4.200.0070.40316.46
5.4.190.0170.37719.24
5.4.180.0230.39019.23
5.4.170.0070.38019.07
5.4.160.0100.40318.93
5.4.150.0100.39319.23
5.4.140.0030.39016.37
5.4.130.0070.40716.34
5.4.120.0200.40016.56
5.4.110.0070.39316.19
5.4.100.0170.38016.19
5.4.90.0070.42016.18
5.4.80.0100.40016.50
5.4.70.0170.40016.54
5.4.60.0070.38316.53
5.4.50.0130.39016.33
5.4.40.0130.39016.16
5.4.30.0100.39016.38
5.4.20.0170.39016.19
5.4.10.0100.41716.48
5.4.00.0100.38015.68
5.3.290.0070.42014.59
5.3.280.0100.43314.45
5.3.270.0070.45314.51
5.3.260.0100.43314.54
5.3.250.0100.43314.46
5.3.240.0100.48014.63
5.3.230.0100.41314.41
5.3.220.0100.55714.48
5.3.210.0130.50714.55
5.3.200.0130.49314.41
5.3.190.0030.48714.41
5.3.180.0200.74714.48
5.3.170.0070.49314.49
5.3.160.0070.54314.52
5.3.150.0070.51314.49
5.3.140.0130.51714.40
5.3.130.0030.48714.50
5.3.120.0030.51014.48
5.3.110.0070.45314.46
5.3.100.0070.45714.07
5.3.90.0130.46013.95
5.3.80.0170.47013.96
5.3.70.0030.46314.03
5.3.60.0170.43013.96
5.3.50.0130.46013.81
5.3.40.0100.72313.89
5.3.30.0100.51313.77
5.3.20.0130.46013.64
5.3.10.0070.49313.70
5.3.00.0100.46313.51
5.2.170.0070.56711.02
5.2.160.0170.49711.06
5.2.150.0100.54011.00
5.2.140.0030.51711.23
5.2.130.0030.49310.95
5.2.120.0070.57011.04
5.2.110.0070.52711.11
5.2.100.0100.50010.96
5.2.90.0100.47311.05
5.2.80.0070.52011.02
5.2.70.0130.49711.11
5.2.60.0070.48310.85
5.2.50.0070.49011.12
5.2.40.0130.48310.91
5.2.30.0070.56311.03
5.2.20.0130.65010.96
5.2.10.0030.61010.79
5.2.00.0100.73710.74
5.1.60.0100.83010.09
5.1.50.0030.8279.98
5.1.40.0100.89710.16
5.1.30.0100.89710.41
5.1.20.0030.79310.28
5.1.10.0030.80010.18
5.1.00.0100.81010.19
5.0.50.0071.4338.74
5.0.40.0071.5838.45
5.0.30.0031.3708.19
5.0.20.0071.4478.30
5.0.10.0131.3438.15
5.0.00.0031.2778.24
4.4.90.0031.3876.04
4.4.80.0071.3305.96
4.4.70.0131.3635.91
4.4.60.0101.3675.98
4.4.50.0071.4536.02
4.4.40.0001.5735.84
4.4.30.0071.4635.82
4.4.20.0031.3636.07
4.4.10.0001.3376.09
4.4.00.0031.3975.86
4.3.110.0131.4135.97
4.3.100.0071.3635.93
4.3.90.0001.3635.88
4.3.80.0031.3875.81
4.3.70.0031.4005.72
4.3.60.0071.4075.71
4.3.50.0071.4535.72
4.3.40.0071.3505.86
4.3.30.0001.3734.63
4.3.20.0001.3904.46
4.3.10.0031.0974.58
4.3.00.0000.57015.57

preferences:
24.37 ms | 403 KiB | 5 Q