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 = 'Hi ' . $name . ', you last logged in on ' . $date; } $t2 = microtime(true); echo 'concat: ' . ($t2-$t1); echo '<br />'; $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 '<br />';

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.2.00.0030.09419.35
7.1.70.0070.09217.18
7.1.60.0160.13819.12
7.1.50.0160.13817.02
7.1.00.0070.21022.57
7.0.200.0030.13616.83
7.0.140.0070.20722.09
7.0.60.0070.16319.89
7.0.50.0070.13717.91
7.0.40.0000.17320.12
7.0.30.0370.13720.04
7.0.20.0270.13320.09
7.0.10.0070.16320.19
7.0.00.0070.18720.12
5.6.280.0100.29321.13
5.6.210.0100.25320.64
5.6.200.0070.18718.18
5.6.190.0030.21020.58
5.6.180.0570.22720.49
5.6.170.0170.19720.38
5.6.160.0070.26320.50
5.6.150.0030.26018.11
5.6.140.0030.20018.15
5.6.130.0130.25318.11
5.6.120.0030.24020.84
5.6.110.0030.22721.09
5.6.100.0130.26721.02
5.6.90.0000.25020.99
5.6.80.0130.23720.35
5.5.350.0170.27020.42
5.5.340.0000.20717.99
5.5.330.0070.27320.25
5.5.320.0030.26320.24
5.5.310.0270.21020.12
5.5.300.0130.26018.03
5.5.290.0070.28017.96
5.5.280.0000.20720.80
5.5.270.0030.20320.85
5.5.260.0070.22020.86
5.5.250.0100.25720.69
5.5.240.0070.26020.18
5.4.450.0670.31019.45
5.4.440.0230.29719.45
5.4.430.0470.31019.45
5.4.420.0530.30019.45
5.4.410.1500.27719.44
5.4.400.0230.27319.45
5.4.390.0330.26319.45
5.4.380.0330.34318.57
5.4.370.0300.32718.61
5.4.360.0230.35718.70
5.4.350.0400.32718.63
5.4.340.0270.32718.70
5.4.320.0050.22512.46
5.4.310.0040.22812.45
5.4.300.0110.26112.46
5.4.290.0060.22512.45
5.4.280.0080.22212.35
5.4.270.0020.23612.35
5.4.260.0080.22912.35
5.4.250.0080.24412.35
5.4.240.0020.24212.35
5.4.230.0070.23912.34
5.4.220.0080.27612.34
5.4.210.0060.22412.34
5.4.200.0060.23312.34
5.4.190.0060.32412.34
5.4.180.0080.24912.34
5.4.170.0070.24312.35
5.4.160.0060.25212.35
5.4.150.0070.23212.34
5.4.140.0040.22912.02
5.4.130.0070.24512.01
5.4.120.0060.24511.97
5.4.110.0060.23911.96
5.4.100.0070.24811.97
5.4.90.0110.24311.97
5.4.80.0060.24311.97
5.4.70.0070.26311.96
5.4.60.0070.25511.96
5.4.50.0060.24711.96
5.4.40.0060.24211.95
5.4.30.0040.25911.95
5.4.20.0080.24311.95
5.4.10.0040.24611.95
5.4.00.0070.26611.44
5.3.290.0070.26312.80
5.3.280.0050.32312.71
5.3.270.0080.26312.72
5.3.260.0070.26412.72
5.3.250.0100.27312.72
5.3.240.0080.26412.72
5.3.230.0060.25712.71
5.3.220.0080.28712.68
5.3.210.0070.29012.68
5.3.200.0070.27912.68
5.3.190.0100.28412.67
5.3.180.0040.26812.67
5.3.170.0040.27112.67
5.3.160.0060.28612.68
5.3.150.0060.30512.67
5.3.140.0120.31212.66
5.3.130.0060.33712.66
5.3.120.0060.29612.66
5.3.110.0080.27112.66
5.3.100.0100.26212.11
5.3.90.0060.26812.09
5.3.80.0080.26512.07
5.3.70.0110.32712.08
5.3.60.0050.27212.07
5.3.50.0090.34612.00
5.3.40.0100.29712.00
5.3.30.0060.27611.95
5.3.20.0120.33111.73
5.3.10.0070.25711.69
5.3.00.0080.34711.68
5.2.170.0070.2989.18
5.2.160.0040.3089.18
5.2.150.0050.3049.18
5.2.140.0080.3359.18
5.2.130.0090.2839.14
5.2.120.0080.3069.14
5.2.110.0040.3319.15
5.2.100.0040.3109.14
5.2.90.0040.2859.14
5.2.80.0080.4159.14
5.2.70.0060.3099.14
5.2.60.0090.2989.09
5.2.50.0040.2899.06
5.2.40.0070.2929.04
5.2.30.0080.2879.01
5.2.20.0050.3309.00
5.2.10.0080.2898.96
5.2.00.0030.3368.81
5.1.60.0040.3068.10
5.1.50.0040.3168.09
5.1.40.0050.3338.08
5.1.30.0040.3478.43
5.1.20.0070.3968.45
5.1.10.0060.3378.18
5.1.00.0080.3228.17
5.0.50.0070.5776.66
5.0.40.0080.6106.43
5.0.30.0030.6166.34
5.0.20.0060.5786.30
5.0.10.0060.6426.28
5.0.00.0040.5656.27
4.4.90.0050.7204.77
4.4.80.0050.5834.75
4.4.70.0030.5584.75
4.4.60.0050.5964.76
4.4.50.0040.5474.77
4.4.40.0030.5804.71
4.4.30.0060.5874.76
4.4.20.0030.6164.85
4.4.10.0050.5534.85
4.4.00.0030.5964.76
4.3.110.0070.5624.67
4.3.100.0050.6224.66
4.3.90.0020.5834.63
4.3.80.0080.5994.59
4.3.70.0130.6214.63
4.3.60.0020.5894.63
4.3.50.0090.5734.63
4.3.40.0040.5934.54
4.3.30.0060.5553.35
4.3.20.0040.5693.32
4.3.10.0070.5143.28
4.3.00.0000.56319.45

preferences:
34.46 ms | 401 KiB | 5 Q