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}{{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.0110.01116.75
8.3.50.0140.00622.28
8.3.40.0170.00018.92
8.3.30.0070.00719.25
8.3.20.0050.00320.16
8.3.10.0080.00021.89
8.3.00.0080.00018.05
8.2.180.0130.01016.88
8.2.170.0120.00322.96
8.2.160.0100.00320.52
8.2.150.0050.00324.18
8.2.140.0120.00324.66
8.2.130.0050.00226.16
8.2.120.0060.00321.04
8.2.110.0060.00320.89
8.2.100.0110.00017.97
8.2.90.0000.00819.09
8.2.80.0030.00517.97
8.2.70.0050.00317.75
8.2.60.0090.00018.03
8.2.50.0070.00418.07
8.2.40.0030.00618.34
8.2.30.0000.00718.29
8.2.20.0000.00818.01
8.2.10.0040.00418.14
8.2.00.0040.00417.89
8.1.280.0120.00925.92
8.1.270.0060.00323.97
8.1.260.0050.00226.35
8.1.250.0040.00428.09
8.1.240.0070.00720.56
8.1.230.0060.00620.97
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0070.00317.48
8.1.190.0030.00617.48
8.1.180.0080.00018.10
8.1.170.0050.00318.71
8.1.160.0000.00722.00
8.1.150.0040.00418.88
8.1.140.0080.00017.60
8.1.130.0070.00017.96
8.1.120.0070.00017.55
8.1.110.0000.00817.63
8.1.100.0000.00817.62
8.1.90.0050.00217.61
8.1.80.0000.00717.61
8.1.70.0030.00317.55
8.1.60.0000.00817.63
8.1.50.0000.00817.56
8.1.40.0040.00417.64
8.1.30.0030.00617.71
8.1.20.0000.00817.82
8.1.10.0030.00517.63
8.1.00.0060.00317.70
8.0.300.0070.00018.77
8.0.290.0040.00416.72
8.0.280.0050.00318.52
8.0.270.0000.00717.28
8.0.260.0000.00717.24
8.0.250.0040.00417.14
8.0.240.0080.00017.10
8.0.230.0070.00017.01
8.0.220.0030.00317.00
8.0.210.0000.00716.93
8.0.200.0000.00617.16
8.0.190.0030.00517.07
8.0.180.0030.00617.10
8.0.170.0040.00416.89
8.0.160.0040.00417.09
8.0.150.0000.00716.98
8.0.140.0000.00817.02
8.0.130.0050.00013.48
8.0.120.0050.00316.98
8.0.110.0080.00017.11
8.0.100.0000.00817.08
8.0.90.0000.00816.99
8.0.80.0040.01116.93
8.0.70.0030.00516.89
8.0.60.0000.00816.89
8.0.50.0050.00316.91
8.0.30.0130.01117.19
8.0.20.0110.00817.41
8.0.10.0000.00717.11
8.0.00.0110.00717.02
7.4.330.0000.00515.00
7.4.320.0000.00616.67
7.4.300.0040.00416.73
7.4.290.0000.00916.70
7.4.280.0030.00716.89
7.4.270.0000.00916.81
7.4.260.0090.00016.84
7.4.250.0040.00416.67
7.4.240.0020.00516.74
7.4.230.0040.00416.54
7.4.220.0060.01216.90
7.4.210.0090.00616.68
7.4.200.0070.00016.84
7.4.160.0100.00716.59
7.4.150.0070.01117.40
7.4.140.0140.00317.86
7.4.130.0110.00516.70
7.4.120.0070.01016.73
7.4.110.0210.00316.44
7.4.100.0060.01016.73
7.4.90.0100.00716.83
7.4.80.0190.00019.39
7.4.70.0110.00716.77
7.4.60.0080.01116.62
7.4.50.0050.00016.39
7.4.40.0110.00816.59
7.4.30.0070.01016.66
7.4.00.0060.00315.30
7.3.330.0060.00013.44
7.3.320.0000.00513.49
7.3.310.0030.00316.48
7.3.300.0070.00016.43
7.3.290.0030.01316.54
7.3.280.0100.00616.48
7.3.270.0090.00917.40
7.3.260.0160.00416.63
7.3.250.0120.00716.78
7.3.240.0100.00716.89
7.3.230.0130.00916.51
7.3.210.0150.00316.57
7.3.200.0030.01619.39
7.3.190.0100.01316.72
7.3.180.0090.00616.75
7.3.170.0060.00916.65
7.3.160.0040.01116.83
7.3.120.0060.00914.95
7.2.330.0110.00716.79
7.2.320.0030.01616.93
7.2.310.0110.00516.99
7.2.300.0170.00716.86
7.2.290.0100.00716.80
7.2.00.0070.00719.60
7.1.100.0080.00618.39
7.1.70.0050.00317.38
7.1.60.0000.01019.25
7.1.50.0070.01617.18
7.1.00.0030.07722.46
7.0.200.0070.00316.61
7.0.140.0030.07022.15
7.0.60.0100.06020.05
7.0.50.0000.05017.85
7.0.40.0030.09320.11
7.0.30.0200.05320.19
7.0.20.0200.04020.16
7.0.10.0130.08720.25
7.0.00.0030.05720.24
5.6.280.0070.07021.11
5.6.210.0070.08020.55
5.6.200.0030.08718.16
5.6.190.0030.05320.63
5.6.180.0530.06320.58
5.6.170.0100.04720.56
5.6.160.0070.07720.57
5.6.150.0030.08718.12
5.6.140.0100.03718.17
5.6.130.0030.05018.23
5.6.120.0100.08321.00
5.6.110.0100.06320.86
5.6.100.0170.07720.98
5.6.90.0000.04721.14
5.6.80.0030.05320.45
5.5.350.0230.06720.33
5.5.340.0100.06317.95
5.5.330.0070.04020.44
5.5.320.0030.07720.24
5.5.310.0200.04720.33
5.5.300.0100.03318.08
5.5.290.0030.08318.09
5.5.280.0030.06720.66
5.5.270.0170.07320.76
5.5.260.0130.06320.68
5.5.250.0070.06720.67
5.5.240.0000.04020.28
5.4.450.0730.05319.36
5.4.440.0870.05719.47
5.4.430.0100.05319.68
5.4.420.0070.06019.56
5.4.410.0100.08019.07
5.4.400.0200.05018.73
5.4.390.0130.05018.62
5.4.380.0000.06718.80
5.4.370.0130.05018.70
5.4.360.0170.04018.78
5.4.350.0060.04112.02
5.4.340.0090.04612.02
5.4.320.0050.04012.51
5.4.310.0060.03712.50
5.4.300.0060.03612.50
5.4.290.0060.03812.50
5.4.280.0030.03712.40
5.4.270.0060.03712.40
5.4.260.0070.03612.40
5.4.250.0070.03612.40
5.4.240.0030.03812.40
5.4.230.0090.03412.39
5.4.220.0060.03712.39
5.4.210.0030.03812.39
5.4.200.0030.04112.39
5.4.190.0060.04412.39
5.4.180.0070.03712.38
5.4.170.0020.04512.40
5.4.160.0060.03612.39
5.4.150.0080.04512.39
5.4.140.0070.04412.07
5.4.130.0080.03912.06
5.4.120.0030.03712.02
5.4.110.0070.03212.02
5.4.100.0020.03812.02
5.4.90.0060.03612.01
5.4.80.0030.03912.02
5.4.70.0020.03812.01
5.4.60.0060.03312.01
5.4.50.0070.03312.02
5.4.40.0120.04312.00
5.4.30.0110.04412.00
5.4.20.0040.04012.00
5.4.10.0050.03512.00
5.4.00.0050.03611.48
5.3.290.0030.04112.80
5.3.280.0070.04412.71
5.3.270.0050.04212.73
5.3.260.0080.04012.72
5.3.250.0070.03712.72
5.3.240.0040.03912.72
5.3.230.0070.03812.71
5.3.220.0120.03912.68
5.3.210.0070.03912.68
5.3.200.0060.04512.68
5.3.190.0030.04012.68
5.3.180.0080.03512.68
5.3.170.0040.03912.67
5.3.160.0080.03412.68
5.3.150.0070.03712.68
5.3.140.0060.03812.66
5.3.130.0060.03812.66
5.3.120.0040.04012.66
5.3.110.0030.04312.66
5.3.100.0040.03812.13
5.3.90.0050.03912.12
5.3.80.0040.03912.11
5.3.70.0060.03612.11
5.3.60.0070.03512.10
5.3.50.0030.04012.05
5.3.40.0060.03612.04
5.3.30.0090.03112.00
5.3.20.0070.04211.78
5.3.10.0060.03711.75
5.3.00.0050.03911.73
5.2.170.0010.0349.24
5.2.160.0030.0309.24
5.2.150.0050.0299.24
5.2.140.0050.0309.24
5.2.130.0040.0299.20
5.2.120.0060.0279.20
5.2.110.0070.0279.20
5.2.100.0040.0289.20
5.2.90.0050.0309.20
5.2.80.0050.0309.19
5.2.70.0010.0349.20
5.2.60.0030.0319.14
5.2.50.0040.0309.12
5.2.40.0010.0319.09
5.2.30.0040.0309.07
5.2.20.0030.0309.06
5.2.10.0040.0288.95
5.2.00.0040.0298.81
5.1.60.0040.0248.09
5.1.50.0010.0278.09
5.1.40.0050.0258.07
5.1.30.0060.0258.43
5.1.20.0050.0268.44
5.1.10.0040.0278.17
5.1.00.0020.0328.17
5.0.50.0050.0196.65
5.0.40.0030.0206.51
5.0.30.0060.0296.32
5.0.20.0020.0206.29
5.0.10.0060.0216.27
5.0.00.0040.0316.26
4.4.90.0020.0174.78
4.4.80.0010.0164.75
4.4.70.0030.0154.76
4.4.60.0030.0154.75
4.4.50.0010.0164.77
4.4.40.0020.0254.71
4.4.30.0020.0164.76
4.4.20.0020.0184.84
4.4.10.0030.0194.85
4.4.00.0020.0274.76
4.3.110.0050.0194.67
4.3.100.0010.0174.67
4.3.90.0030.0144.63
4.3.80.0020.0254.58
4.3.70.0020.0154.63
4.3.60.0030.0144.63
4.3.50.0030.0154.63
4.3.40.0030.0234.54
4.3.30.0020.0163.30
4.3.20.0050.0183.28
4.3.10.0000.0183.23
4.3.00.0100.0277.07

preferences:
37.77 ms | 401 KiB | 5 Q