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 = array('inner' => 'oi'); 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.0070.00716.75
8.3.50.0130.00821.99
8.3.40.0100.01018.87
8.3.30.0110.00419.23
8.3.20.0040.00420.21
8.3.10.0070.00021.86
8.3.00.0080.00017.89
8.2.180.0070.01116.75
8.2.170.0070.01322.96
8.2.160.0070.00720.40
8.2.150.0090.00024.18
8.2.140.0120.00324.66
8.2.130.0070.00026.16
8.2.120.0110.00720.96
8.2.110.0030.01822.20
8.2.100.0040.00819.62
8.2.90.0000.00819.27
8.2.80.0040.00417.97
8.2.70.0000.00817.60
8.2.60.0070.00317.93
8.2.50.0080.00318.07
8.2.40.0030.00518.34
8.2.30.0050.00218.32
8.2.20.0000.00917.88
8.2.10.0040.00418.20
8.2.00.0070.00017.81
8.1.280.0060.00925.92
8.1.270.0040.00423.79
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0100.01023.79
8.1.230.0110.00019.04
8.1.220.0030.00617.76
8.1.210.0080.00018.77
8.1.200.0070.00317.34
8.1.190.0040.00417.35
8.1.180.0000.00818.10
8.1.170.0000.00818.43
8.1.160.0000.00722.11
8.1.150.0040.00418.95
8.1.140.0000.00717.38
8.1.130.0030.00317.82
8.1.120.0000.00817.46
8.1.110.0080.00017.50
8.1.100.0050.00217.51
8.1.90.0040.00417.38
8.1.80.0070.00017.48
8.1.70.0030.00317.38
8.1.60.0030.00517.61
8.1.50.0030.00517.43
8.1.40.0040.00417.43
8.1.30.0060.00317.53
8.1.20.0000.00817.65
8.1.10.0000.00817.47
8.1.00.0000.00817.38
8.0.300.0040.00418.77
8.0.290.0040.00416.63
8.0.280.0040.00418.52
8.0.270.0040.00417.32
8.0.260.0000.00717.18
8.0.250.0030.00317.01
8.0.240.0030.00517.02
8.0.230.0080.00017.04
8.0.220.0000.00717.03
8.0.210.0030.00316.86
8.0.200.0000.00617.00
8.0.190.0030.00617.04
8.0.180.0000.00716.93
8.0.170.0050.00317.03
8.0.160.0000.00717.00
8.0.150.0040.00416.96
8.0.140.0030.00616.90
8.0.130.0030.00313.39
8.0.120.0030.00516.98
8.0.110.0040.00416.89
8.0.100.0000.00716.82
8.0.90.0070.00017.00
8.0.80.0090.00917.02
8.0.70.0070.00016.86
8.0.60.0000.00716.75
8.0.50.0040.00416.86
8.0.30.0110.01317.23
8.0.20.0090.01117.40
8.0.10.0050.00216.91
8.0.00.0090.01116.81
7.4.330.0030.00315.11
7.4.320.0030.00316.82
7.4.300.0050.00216.87
7.4.290.0070.00016.82
7.4.280.0060.00616.65
7.4.270.0000.00816.59
7.4.260.0030.00316.86
7.4.250.0050.00216.74
7.4.240.0030.00316.76
7.4.230.0040.00416.81
7.4.220.0090.00916.83
7.4.210.0060.00716.65
7.4.200.0000.00816.93
7.4.160.0110.00616.96
7.4.150.0070.01017.40
7.4.140.0070.01017.86
7.4.130.0120.00516.79
7.4.120.0090.01016.89
7.4.110.0110.00716.77
7.4.100.0080.00816.75
7.4.90.0090.00916.77
7.4.80.0090.01219.39
7.4.70.0060.01016.72
7.4.60.0070.01116.77
7.4.50.0050.00016.54
7.4.40.0120.00416.80
7.4.30.0100.00616.88
7.4.00.0040.01114.98
7.3.330.0000.00613.52
7.3.320.0000.00513.40
7.3.310.0000.00716.49
7.3.300.0030.00316.55
7.3.290.0060.00816.59
7.3.280.0080.00916.63
7.3.270.0070.01017.40
7.3.260.0110.00616.69
7.3.250.0130.00516.74
7.3.240.0110.00616.75
7.3.230.0040.01216.63
7.3.210.0130.00716.93
7.3.200.0070.01019.39
7.3.190.0070.01016.76
7.3.180.0100.00716.90
7.3.170.0040.01216.92
7.3.160.0080.00816.73
7.3.120.0040.01115.09
7.2.330.0140.00316.89
7.2.320.0060.01216.88
7.2.310.0030.01516.84
7.2.300.0100.00717.00
7.2.290.0100.01016.88
7.2.00.0040.01119.57
7.1.200.0100.00315.62
7.1.100.0050.00518.08
7.1.70.0000.00717.45
7.1.60.0060.01319.25
7.1.50.0130.01017.15
7.1.00.0030.07722.46
7.0.200.0040.00416.86
7.0.140.0000.07721.99
7.0.60.0170.06319.88
7.0.50.0000.09017.99
7.0.40.0100.08320.40
7.0.30.0370.06020.35
7.0.20.0230.08020.25
7.0.10.0070.06320.17
7.0.00.0070.04720.27
5.6.280.0000.07720.92
5.6.210.0170.07020.60
5.6.200.0130.05018.27
5.6.190.0000.07720.41
5.6.180.0300.05720.47
5.6.170.0230.05720.52
5.6.160.0070.04020.45
5.6.150.0100.05018.15
5.6.140.0070.03718.21
5.6.130.0070.05718.18
5.6.120.0030.04021.14
5.6.110.0170.07720.89
5.6.100.0070.06321.05
5.6.90.0030.04321.00
5.6.80.0130.07320.39
5.5.350.0230.08020.38
5.5.340.0200.06717.98
5.5.330.0030.09320.27
5.5.320.0230.06320.42
5.5.310.0400.07720.38
5.5.300.0070.03318.09
5.5.290.0030.08717.98
5.5.280.0070.08020.81
5.5.270.0130.04020.88
5.5.260.0030.06320.96
5.5.250.0070.04320.50
5.5.240.0170.06720.17
5.4.450.0700.05719.61
5.4.440.0030.07019.61
5.4.430.0170.06319.60
5.4.420.0200.07719.58
5.4.410.0100.05318.69
5.4.400.0230.06318.74
5.4.390.0300.05318.84
5.4.380.0100.06718.51
5.4.370.0130.05018.75
5.4.360.0030.04018.78
5.4.350.0040.03912.02
5.4.340.0060.03912.02
5.4.320.0080.03412.51
5.4.310.0080.04512.50
5.4.300.0130.03012.51
5.4.290.0110.04412.50
5.4.280.0100.04412.40
5.4.270.0080.03812.40
5.4.260.0070.03712.40
5.4.250.0120.04612.40
5.4.240.0100.04812.40
5.4.230.0150.03912.39
5.4.220.0050.04912.39
5.4.210.0060.03812.39
5.4.200.0080.04112.39
5.4.190.0120.05512.38
5.4.180.0080.04712.38
5.4.170.0100.03612.39
5.4.160.0050.04612.39
5.4.150.0070.03512.39
5.4.140.0050.03712.07
5.4.130.0070.03412.06
5.4.120.0040.03712.02
5.4.110.0040.03712.01
5.4.100.0080.03312.01
5.4.90.0100.03312.02
5.4.80.0030.03912.02
5.4.70.0050.03512.01
5.4.60.0050.03512.01
5.4.50.0070.03812.01
5.4.40.0100.04512.00
5.4.30.0070.04712.00
5.4.20.0070.04512.00
5.4.10.0040.03712.00
5.4.00.0050.03711.49
5.3.290.0100.05612.80
5.3.280.0080.03512.71
5.3.270.0060.04012.73
5.3.260.0050.04012.72
5.3.250.0040.03912.72
5.3.240.0050.03912.72
5.3.230.0080.03612.71
5.3.220.0060.03712.68
5.3.210.0070.03612.68
5.3.200.0040.03912.68
5.3.190.0020.04212.67
5.3.180.0040.03912.67
5.3.170.0060.03612.67
5.3.160.0120.03112.68
5.3.150.0040.03912.67
5.3.140.0090.03512.66
5.3.130.0040.04112.65
5.3.120.0040.04212.66
5.3.110.0100.03512.66
5.3.100.0040.03912.14
5.3.90.0030.04112.12
5.3.80.0070.03612.11
5.3.70.0060.03612.11
5.3.60.0050.03812.09
5.3.50.0070.04112.04
5.3.40.0050.03912.04
5.3.30.0110.04112.00
5.3.20.0070.04411.78
5.3.10.0060.04911.75
5.3.00.0070.04911.74
5.2.170.0040.0319.24
5.2.160.0080.0319.24
5.2.150.0040.0359.24
5.2.140.0060.0349.23
5.2.130.0060.0339.20
5.2.120.0090.0309.20
5.2.110.0040.0339.20
5.2.100.0080.0259.20
5.2.90.0040.0319.20
5.2.80.0140.0259.19
5.2.70.0080.0329.20
5.2.60.0030.0379.15
5.2.50.0050.0319.12
5.2.40.0040.0299.09
5.2.30.0050.0289.07
5.2.20.0040.0299.06
5.2.10.0050.0288.95
5.2.00.0020.0318.81
5.1.60.0040.0248.09
5.1.50.0020.0268.09
5.1.40.0030.0278.07
5.1.30.0040.0268.42
5.1.20.0050.0268.44
5.1.10.0030.0268.17
5.1.00.0000.0308.17
5.0.50.0030.0226.64
5.0.40.0040.0186.51
5.0.30.0040.0306.32
5.0.20.0050.0186.29
5.0.10.0050.0196.27
5.0.00.0030.0336.26
4.4.90.0050.0154.78
4.4.80.0010.0184.76
4.4.70.0030.0164.75
4.4.60.0030.0174.75
4.4.50.0030.0154.77
4.4.40.0050.0264.70
4.4.30.0040.0204.76
4.4.20.0010.0174.84
4.4.10.0040.0144.85
4.4.00.0050.0254.76
4.3.110.0030.0194.67
4.3.100.0050.0134.66
4.3.90.0060.0164.63
4.3.80.0010.0264.58
4.3.70.0030.0164.63
4.3.60.0040.0144.63
4.3.50.0030.0194.63
4.3.40.0030.0254.54
4.3.30.0020.0163.30
4.3.20.0010.0163.28
4.3.10.0040.0133.24
4.3.00.0200.0177.21

preferences:
50.98 ms | 401 KiB | 5 Q