3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MicroTemplateEngine { public $data = array(); private $tpl; function __construct($f) { $this->tpl = $f; } function __set($name, $value) { $this->data[$name] = $value; } function __toString() { $out = $this->tpl; foreach ($this->data as $_key => $_value) { $out = str_replace('#{{' . $_key . '}}', $_value, $out); } $out = preg_replace('/#{{.*?}}/' , '' , $out ); return $out; } } $t = new MicroTemplateEngine('<div>#{{inner}}</div>'); $t->inner = 'oi'; var_dump($t); echo $t;

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)
8.3.60.0170.00318.55
8.3.50.0120.00322.05
8.3.40.0120.00319.11
8.3.30.0110.00419.00
8.3.20.0040.00420.34
8.3.10.0080.00021.81
8.3.00.0040.00417.80
8.2.180.0190.00316.88
8.2.170.0090.00922.96
8.2.160.0070.00722.44
8.2.150.0000.00824.18
8.2.140.0070.00724.66
8.2.130.0040.00426.16
8.2.120.0050.00321.02
8.2.110.0060.00319.34
8.2.100.0040.00818.03
8.2.90.0000.00819.27
8.2.80.0040.00417.97
8.2.70.0050.00318.00
8.2.60.0040.00418.03
8.2.50.0030.00918.07
8.2.40.0000.00818.16
8.2.30.0040.00418.33
8.2.20.0050.00317.85
8.2.10.0040.00418.20
8.2.00.0050.00317.80
8.1.280.0090.01225.92
8.1.270.0060.01323.71
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0000.00923.86
8.1.230.0040.00820.94
8.1.220.0050.00317.74
8.1.210.0080.00018.77
8.1.200.0040.00417.48
8.1.190.0060.00317.36
8.1.180.0000.00818.10
8.1.170.0000.00818.76
8.1.160.0040.00421.91
8.1.150.0000.00718.87
8.1.140.0000.00717.56
8.1.130.0000.00717.85
8.1.120.0000.00717.61
8.1.110.0040.00417.52
8.1.100.0040.00417.54
8.1.90.0040.00417.63
8.1.80.0040.00417.70
8.1.70.0030.00317.58
8.1.60.0030.00617.62
8.1.50.0040.00417.75
8.1.40.0000.00717.55
8.1.30.0000.00817.75
8.1.20.0040.00417.64
8.1.10.0040.00417.67
8.1.00.0040.00417.59
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0000.00818.47
8.0.270.0070.00017.29
8.0.260.0030.00317.29
8.0.250.0070.00017.09
8.0.240.0050.00317.11
8.0.230.0000.00817.05
8.0.220.0040.00416.91
8.0.210.0000.00717.04
8.0.200.0060.00017.11
8.0.190.0050.00316.99
8.0.180.0080.00017.10
8.0.170.0000.00717.04
8.0.160.0030.00417.09
8.0.150.0040.00417.01
8.0.140.0080.00017.00
8.0.130.0030.00313.50
8.0.120.0020.00516.98
8.0.110.0040.00417.04
8.0.100.0040.00417.02
8.0.90.0000.00816.86
8.0.80.0070.00716.98
8.0.70.0030.00517.16
8.0.60.0070.00016.93
8.0.50.0040.00417.10
8.0.30.0120.01417.08
8.0.20.0090.01017.40
8.0.10.0000.00716.95
8.0.00.0140.00417.06
7.4.330.0000.00515.11
7.4.320.0030.00316.69
7.4.300.0030.00316.79
7.4.290.0090.00316.76
7.4.280.0040.00716.65
7.4.270.0070.00016.82
7.4.260.0070.00316.68
7.4.250.0050.00216.77
7.4.240.0070.00216.75
7.4.230.0050.00316.84
7.4.220.0070.01116.67
7.4.210.0000.01516.88
7.4.200.0000.00716.91
7.4.160.0030.01316.79
7.4.150.0030.01417.40
7.4.140.0150.00317.86
7.4.130.0080.00816.64
7.4.120.0060.01116.82
7.4.110.0100.01316.57
7.4.100.0110.00516.46
7.4.90.0060.01116.86
7.4.80.0120.01219.39
7.4.70.0100.00716.66
7.4.60.0100.01116.79
7.4.50.0060.00316.52
7.4.40.0140.00316.68
7.4.30.0080.00816.59
7.4.00.0040.01414.85
7.3.330.0000.00713.33
7.3.320.0000.00513.44
7.3.310.0030.00316.39
7.3.300.0030.00316.53
7.3.290.0100.00716.60
7.3.280.0080.01216.55
7.3.270.0100.00717.40
7.3.260.0040.01516.93
7.3.250.0100.00816.70
7.3.240.0110.00616.60
7.3.230.0070.01016.75
7.3.210.0090.00916.54
7.3.200.0120.00619.39
7.3.190.0120.00616.80
7.3.180.0140.00416.72
7.3.170.0130.00316.70
7.3.160.0080.00816.82
7.3.120.0000.01414.79
7.2.330.0100.01016.94
7.2.320.0080.00816.95
7.2.310.0120.00816.98
7.2.300.0070.01016.98
7.2.290.0060.01516.91
7.2.00.0070.00719.49
7.1.200.0040.00416.07
7.1.100.0040.00417.97
7.1.70.0000.00717.11
7.1.60.0090.00619.25
7.1.50.0140.01017.00
7.1.00.0000.08022.29
7.0.200.0070.00316.93
7.0.140.0030.07322.07
7.0.60.0070.03719.99
7.0.50.0070.04717.92
7.0.40.0130.03720.20
7.0.30.0230.07020.21
7.0.20.0270.06320.26
7.0.10.0270.04720.27
7.0.00.0070.08020.27
5.6.280.0000.07720.99
5.6.210.0030.04020.73
5.6.200.0030.08318.15
5.6.190.0100.03720.42
5.6.180.0270.05320.55
5.6.170.0270.07720.51
5.6.160.0070.04720.55
5.6.150.0000.07018.24
5.6.140.0170.07018.27
5.6.130.0030.09318.15
5.6.120.0070.08321.04
5.6.110.0030.09021.14
5.6.100.0030.04321.01
5.6.90.0030.05021.11
5.6.80.0100.04720.36
5.6.70.4370.04320.48
5.5.350.0130.07320.40
5.5.340.0000.05318.04
5.5.330.0100.06320.19
5.5.320.0400.07020.52
5.5.310.0330.07320.34
5.5.300.0100.05017.94
5.5.290.0070.06018.08
5.5.280.0170.08320.81
5.5.270.0000.08720.77
5.5.260.0070.08020.87
5.5.250.0030.05320.57
5.5.240.4270.04020.38
5.4.450.1270.05719.48
5.4.440.0070.03719.46
5.4.430.0430.03719.19
5.4.420.1470.03319.52
5.4.410.1200.06019.36
5.4.400.0900.05019.22
5.4.390.1400.03718.95
5.4.380.0400.05318.77
5.4.370.0230.06318.74
5.4.360.0530.06018.57
5.4.350.0400.05318.48
5.4.340.0470.05018.80
5.4.320.0050.03912.50
5.4.310.0050.03812.50
5.4.300.0060.03712.51
5.4.290.0090.03512.50
5.4.280.0050.03612.40
5.4.270.0050.03912.40
5.4.260.0100.03412.40
5.4.250.0030.04012.40
5.4.240.0070.03412.40
5.4.230.0030.03912.39
5.4.220.0060.03612.39
5.4.210.0080.03312.39
5.4.200.0050.03912.39
5.4.190.0050.03712.38
5.4.180.0080.03412.39
5.4.170.0060.03612.40
5.4.160.0050.03812.40
5.4.150.0060.03712.39
5.4.140.0040.04012.07
5.4.130.0030.03712.06
5.4.120.0050.03612.02
5.4.110.0050.03612.02
5.4.100.0040.03612.02
5.4.90.0090.03312.02
5.4.80.0080.03412.02
5.4.70.0060.03412.01
5.4.60.0040.03612.01
5.4.50.0060.03512.01
5.4.40.0060.03412.00
5.4.30.0070.03511.99
5.4.20.0060.03512.00
5.4.10.0040.03612.00
5.4.00.0060.03511.48
5.3.290.0080.04212.80
5.3.280.0080.03612.71
5.3.270.0080.03712.73
5.3.260.0060.03912.72
5.3.250.0110.03312.71
5.3.240.0050.03912.72
5.3.230.0080.03512.71
5.3.220.0060.04812.68
5.3.210.0070.03912.68
5.3.200.0050.03912.68
5.3.190.0050.03712.68
5.3.180.0040.03812.68
5.3.170.0070.03612.67
5.3.160.0070.03512.68
5.3.150.0070.03712.67
5.3.140.0060.03612.66
5.3.130.0050.03912.66
5.3.120.0070.03712.66
5.3.110.0070.03712.66
5.3.100.0070.03712.13
5.3.90.0090.03412.12
5.3.80.0030.04012.11
5.3.70.0070.03512.11
5.3.60.0060.03612.10
5.3.50.0130.03012.04
5.3.40.0060.03612.04
5.3.30.0080.03312.02
5.3.20.0060.03411.78
5.3.10.0060.03511.75
5.3.00.0040.03811.74
5.2.170.0040.0319.24
5.2.160.0040.0319.24
5.2.150.0060.0369.24
5.2.140.0080.0409.24
5.2.130.0080.0389.20
5.2.120.0070.0279.20
5.2.110.0050.0289.20
5.2.100.0040.0289.20
5.2.90.0050.0429.20
5.2.80.0090.0269.20
5.2.70.0050.0309.19
5.2.60.0040.0319.15
5.2.50.0030.0349.11
5.2.40.0070.0289.09
5.2.30.0050.0299.07
5.2.20.0030.0309.06
5.2.10.0050.0288.95
5.2.00.0060.0288.82
5.1.60.0030.0268.10
5.1.50.0090.0258.09
5.1.40.0060.0238.07
5.1.30.0060.0248.43
5.1.20.0050.0268.45
5.1.10.0080.0238.17
5.1.00.0030.0268.17
5.0.50.0030.0216.65
5.0.40.0030.0206.50
5.0.30.0040.0336.32
5.0.20.0040.0196.29
5.0.10.0040.0196.27
5.0.00.0030.0326.26
4.4.90.0020.0164.78
4.4.80.0010.0174.75
4.4.70.0030.0154.75
4.4.60.0050.0134.76
4.4.50.0050.0134.77
4.4.40.0010.0274.71
4.4.30.0010.0174.76
4.4.20.0020.0164.84
4.4.10.0040.0144.85
4.4.00.0060.0214.76
4.3.110.0020.0164.67
4.3.100.0030.0154.66
4.3.90.0030.0154.63
4.3.80.0030.0234.59
4.3.70.0050.0124.63
4.3.60.0030.0144.63
4.3.50.0030.0154.63
4.3.40.0040.0234.54
4.3.30.0020.0153.30
4.3.20.0030.0153.28
4.3.10.0020.0153.24
4.3.00.0130.03015.25

preferences:
31.6 ms | 401 KiB | 5 Q