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 = file_get_contents($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.0100.01016.63
8.3.50.0140.00621.98
8.3.40.0060.00918.96
8.3.30.0110.00419.09
8.3.20.0080.00020.21
8.3.10.0040.00421.91
8.3.00.0080.00018.03
8.2.180.0040.01117.13
8.2.170.0070.01322.96
8.2.160.0070.00720.47
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0050.00321.08
8.2.110.0000.00921.05
8.2.100.0040.00717.91
8.2.90.0030.00519.21
8.2.80.0060.00317.97
8.2.70.0030.00517.75
8.2.60.0050.00518.05
8.2.50.0060.00618.07
8.2.40.0050.00318.22
8.2.30.0000.00818.36
8.2.20.0040.00417.84
8.2.10.0000.00818.00
8.2.00.0000.00817.84
8.1.280.0100.00725.92
8.1.270.0080.00023.96
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0030.00619.21
8.1.230.0040.00821.00
8.1.220.0000.00817.77
8.1.210.0000.00818.77
8.1.200.0040.00717.38
8.1.190.0000.00917.35
8.1.180.0040.00418.10
8.1.170.0080.00018.59
8.1.160.0050.00221.99
8.1.150.0000.00718.86
8.1.140.0000.00717.55
8.1.130.0000.00817.85
8.1.120.0040.00417.52
8.1.110.0090.00017.39
8.1.100.0040.00417.43
8.1.90.0040.00417.47
8.1.80.0060.00317.48
8.1.70.0000.00817.51
8.1.60.0040.00417.60
8.1.50.0040.00417.51
8.1.40.0030.00517.54
8.1.30.0000.00817.61
8.1.20.0030.00617.62
8.1.10.0000.00817.52
8.1.00.0020.00517.47
8.0.300.0000.00718.77
8.0.290.0000.00716.88
8.0.280.0070.00018.55
8.0.270.0070.00017.24
8.0.260.0040.00417.41
8.0.250.0070.00017.14
8.0.240.0040.00417.14
8.0.230.0070.00017.00
8.0.220.0030.00317.07
8.0.210.0050.00317.09
8.0.200.0070.00017.02
8.0.190.0040.00417.09
8.0.180.0070.00016.94
8.0.170.0040.00417.12
8.0.160.0000.00717.09
8.0.150.0000.00716.91
8.0.140.0000.00717.02
8.0.130.0000.00613.45
8.0.120.0000.00816.98
8.0.110.0000.00717.07
8.0.100.0050.00216.86
8.0.90.0000.00716.94
8.0.80.0040.01117.05
8.0.70.0040.00417.05
8.0.60.0000.00717.02
8.0.50.0050.00316.90
8.0.30.0110.01017.08
8.0.20.0090.01017.40
8.0.10.0000.00717.17
8.0.00.0160.00516.94
7.4.330.0030.00315.22
7.4.320.0030.00316.68
7.4.300.0070.00016.66
7.4.290.0000.00816.81
7.4.280.0040.00716.81
7.4.270.0030.00316.74
7.4.260.0060.00316.82
7.4.250.0060.00316.81
7.4.240.0000.00716.71
7.4.230.0000.00716.65
7.4.220.0000.01816.75
7.4.210.0040.01116.89
7.4.200.0000.00716.59
7.4.160.0140.00716.86
7.4.150.0120.00617.40
7.4.140.0150.00517.86
7.4.130.0070.01016.91
7.4.120.0130.00816.86
7.4.110.0130.00616.84
7.4.100.0150.00316.64
7.4.90.0060.01216.81
7.4.80.0100.01119.39
7.4.70.0060.01016.67
7.4.60.0100.01016.98
7.4.50.0060.00316.76
7.4.40.0110.01116.78
7.4.30.0030.01416.88
7.4.00.0060.00315.36
7.3.330.0000.00613.72
7.3.320.0030.00313.59
7.3.310.0030.00316.69
7.3.300.0030.00316.70
7.3.290.0040.01116.68
7.3.280.0080.00916.63
7.3.270.0030.01517.40
7.3.260.0100.01016.56
7.3.250.0150.00816.76
7.3.240.0100.00716.76
7.3.230.0080.00816.50
7.3.210.0070.01016.63
7.3.200.0110.00719.39
7.3.190.0110.00616.80
7.3.180.0120.00916.51
7.3.170.0100.00616.72
7.3.160.0070.01016.64
7.3.120.0120.00315.13
7.2.330.0100.00716.88
7.2.320.0140.00316.81
7.2.310.0110.00716.93
7.2.300.0030.01316.85
7.2.290.0100.01016.78
7.2.00.0090.00019.49
7.1.100.0110.00018.19
7.1.70.0000.00917.59
7.1.60.0120.00819.25
7.1.50.0060.01617.10
7.1.00.0100.07022.30
7.0.200.0000.00716.61
7.0.140.0030.07321.95
7.0.60.0030.05719.92
7.0.50.0170.06717.87
7.0.40.0030.04320.30
7.0.30.0100.05020.27
7.0.20.0170.04320.18
7.0.10.0100.07020.08
7.0.00.0100.03720.24
5.6.280.0000.07721.13
5.6.210.0100.08020.66
5.6.200.0070.05318.15
5.6.190.0070.04020.46
5.6.180.3700.04020.55
5.6.170.0300.03720.47
5.6.160.0130.08020.54
5.6.150.0030.06318.14
5.6.140.0130.06018.14
5.6.130.0030.04318.14
5.6.120.0100.08021.06
5.6.110.0130.03721.12
5.6.100.0100.08321.14
5.6.90.0070.07721.11
5.6.80.0070.04720.53
5.6.70.0230.04320.43
5.5.350.0300.07320.39
5.5.340.0030.04318.02
5.5.330.0030.08020.38
5.5.320.0400.06720.51
5.5.310.0270.07320.34
5.5.300.0130.07017.98
5.5.290.0100.03717.91
5.5.280.0100.07320.89
5.5.270.0000.06020.90
5.5.260.0100.08320.85
5.5.250.0070.07320.63
5.5.240.0300.07020.20
5.4.450.0270.05719.61
5.4.440.0670.05719.63
5.4.430.0100.05319.51
5.4.420.0200.04719.56
5.4.410.0030.06019.08
5.4.400.0100.05018.54
5.4.390.0100.05018.59
5.4.380.0070.06018.54
5.4.370.0130.05018.77
5.4.360.0000.04318.63
5.4.350.0040.04712.03
5.4.340.0050.03612.02
5.4.320.0050.03712.50
5.4.310.0070.03812.50
5.4.300.0070.04112.51
5.4.290.0050.04712.51
5.4.280.0080.03412.40
5.4.270.0070.03512.40
5.4.260.0030.04212.40
5.4.250.0070.03812.40
5.4.240.0060.03812.40
5.4.230.0060.03912.39
5.4.220.0070.03612.39
5.4.210.0060.03512.39
5.4.200.0060.03812.39
5.4.190.0100.03512.39
5.4.180.0050.03812.39
5.4.170.0040.04912.40
5.4.160.0060.03612.40
5.4.150.0080.03412.39
5.4.140.0090.03512.08
5.4.130.0050.03712.07
5.4.120.0070.03512.03
5.4.110.0060.03712.02
5.4.100.0090.03812.02
5.4.90.0070.04312.02
5.4.80.0070.04312.02
5.4.70.0050.03612.02
5.4.60.0030.04112.02
5.4.50.0080.04712.02
5.4.40.0100.04612.00
5.4.30.0060.03812.00
5.4.20.0050.05712.00
5.4.10.0120.04212.00
5.4.00.0090.03611.49
5.3.290.0050.04012.80
5.3.280.0070.04312.71
5.3.270.0070.03912.72
5.3.260.0130.04012.72
5.3.250.0050.03812.72
5.3.240.0080.05212.71
5.3.230.0110.04412.71
5.3.220.0040.04012.68
5.3.210.0090.05112.68
5.3.200.0050.03812.68
5.3.190.0050.03912.68
5.3.180.0040.04012.68
5.3.170.0080.04712.67
5.3.160.0080.03812.67
5.3.150.0080.04512.67
5.3.140.0060.03612.66
5.3.130.0050.04112.66
5.3.120.0090.03712.66
5.3.110.0060.03912.66
5.3.100.0060.03712.14
5.3.90.0080.03412.12
5.3.80.0040.03812.11
5.3.70.0050.03712.12
5.3.60.0080.03412.10
5.3.50.0050.03812.05
5.3.40.0070.03612.05
5.3.30.0060.04012.01
5.3.20.0060.03611.78
5.3.10.0050.03511.75
5.3.00.0060.03711.74
5.2.170.0060.0299.25
5.2.160.0040.0299.24
5.2.150.0070.0299.25
5.2.140.0040.0319.24
5.2.130.0060.0289.20
5.2.120.0030.0309.20
5.2.110.0040.0309.21
5.2.100.0070.0269.20
5.2.90.0080.0259.20
5.2.80.0040.0309.20
5.2.70.0040.0319.20
5.2.60.0030.0379.16
5.2.50.0040.0419.12
5.2.40.0030.0319.11
5.2.30.0070.0289.08
5.2.20.0070.0279.07
5.2.10.0060.0278.95
5.2.00.0060.0288.82
5.1.60.0070.0298.11
5.1.50.0040.0278.10
5.1.40.0060.0228.09
5.1.30.0040.0318.43
5.1.20.0040.0318.45
5.1.10.0030.0278.18
5.1.00.0060.0248.18
5.0.50.0020.0236.65
5.0.40.0020.0216.52
5.0.30.0060.0286.32
5.0.20.0020.0216.29
5.0.10.0030.0216.27
5.0.00.0020.0336.27
4.4.90.0030.0174.77
4.4.80.0060.0194.75
4.4.70.0050.0174.76
4.4.60.0020.0164.75
4.4.50.0050.0144.77
4.4.40.0030.0264.71
4.4.30.0050.0144.76
4.4.20.0030.0154.84
4.4.10.0040.0144.85
4.4.00.0030.0254.76
4.3.110.0030.0164.67
4.3.100.0030.0164.66
4.3.90.0020.0164.64
4.3.80.0030.0244.59
4.3.70.0030.0164.63
4.3.60.0030.0144.63
4.3.50.0040.0144.63
4.3.40.0040.0254.54
4.3.30.0020.0163.30
4.3.20.0010.0193.28
4.3.10.0020.0163.24
4.3.00.0200.0237.18

preferences:
47.15 ms | 401 KiB | 5 Q