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('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.0070.00718.04
8.3.40.0140.00719.14
8.3.30.0090.00619.08
8.3.20.0040.00420.34
8.3.10.0050.00321.73
8.3.00.0040.00418.16
8.2.180.0110.01116.88
8.2.170.0090.00622.96
8.2.160.0070.00720.43
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0030.00326.16
8.2.120.0080.00021.09
8.2.110.0090.00022.12
8.2.100.0070.00719.64
8.2.90.0040.00419.17
8.2.80.0030.00617.97
8.2.70.0040.00417.63
8.2.60.0000.01117.93
8.2.50.0030.00718.07
8.2.40.0050.00318.16
8.2.30.0040.00418.31
8.2.20.0040.00417.82
8.2.10.0000.00817.94
8.2.00.0000.00717.82
8.1.270.0000.00823.84
8.1.260.0050.00326.35
8.1.250.0040.00428.09
8.1.240.0100.00023.96
8.1.230.0070.00419.13
8.1.220.0000.00817.74
8.1.210.0030.00518.77
8.1.200.0040.00417.48
8.1.190.0060.00317.35
8.1.180.0040.00418.10
8.1.170.0050.00318.56
8.1.160.0050.00222.02
8.1.150.0000.00718.98
8.1.140.0050.00217.38
8.1.130.0030.00517.79
8.1.120.0030.00317.39
8.1.110.0000.00817.52
8.1.100.0040.00417.50
8.1.90.0000.00817.45
8.1.80.0000.00817.44
8.1.70.0030.00317.41
8.1.60.0040.00417.62
8.1.50.0040.00417.54
8.1.40.0000.00717.56
8.1.30.0000.00817.49
8.1.20.0000.00717.49
8.1.10.0050.00217.59
8.1.00.0000.00817.49
8.0.300.0070.00018.77
8.0.290.0000.00816.75
8.0.280.0030.00318.45
8.0.270.0000.00717.27
8.0.260.0030.00317.27
8.0.250.0000.00816.90
8.0.240.0040.00416.92
8.0.230.0030.00316.93
8.0.220.0030.00316.88
8.0.210.0030.00316.91
8.0.200.0040.00416.91
8.0.190.0040.00417.07
8.0.180.0040.00416.87
8.0.170.0000.00816.95
8.0.160.0000.00716.94
8.0.150.0000.00817.02
8.0.140.0070.00016.82
8.0.130.0000.00513.39
8.0.120.0000.00816.86
8.0.110.0080.00016.90
8.0.100.0040.00416.84
8.0.90.0040.00416.98
8.0.80.0070.01316.92
8.0.70.0040.00417.02
8.0.60.0000.00716.83
8.0.50.0030.00616.90
8.0.30.0110.01016.82
8.0.20.0110.00917.40
8.0.10.0070.00016.95
8.0.00.0090.00916.79
7.4.330.0050.00015.13
7.4.320.0060.00016.56
7.4.300.0030.00316.61
7.4.290.0070.00016.51
7.4.280.0090.00316.43
7.4.270.0000.00716.54
7.4.260.0060.00016.50
7.4.250.0070.00016.63
7.4.240.0060.00116.57
7.4.230.0040.00416.60
7.4.220.0110.01416.69
7.4.210.0030.01016.63
7.4.200.0000.00716.50
7.4.160.0030.01416.41
7.4.150.0100.00717.40
7.4.140.0130.01217.86
7.4.130.0030.01316.54
7.4.120.0110.01016.65
7.4.110.0060.01116.33
7.4.100.0120.00916.48
7.4.90.0080.00916.37
7.4.80.0180.00619.39
7.4.70.0060.00916.56
7.4.60.0100.01016.70
7.4.50.0000.00816.42
7.4.40.0140.00716.63
7.4.30.0080.00816.37
7.4.00.0170.00014.80
7.3.330.0030.00313.23
7.3.320.0060.00013.44
7.3.310.0070.00016.39
7.3.300.0040.00416.32
7.3.290.0000.01316.36
7.3.280.0080.00816.37
7.3.270.0160.00317.40
7.3.260.0140.00316.64
7.3.250.0080.01016.42
7.3.240.0130.00316.44
7.3.230.0140.00316.55
7.3.210.0060.01016.41
7.3.200.0100.01019.39
7.3.190.0030.01916.59
7.3.180.0070.01116.49
7.3.170.0070.00916.39
7.3.160.0060.00916.47
7.3.120.0000.01114.85
7.2.330.0000.01716.64
7.2.320.0030.02016.61
7.2.310.0100.00716.76
7.2.300.0070.01016.49
7.2.290.0210.00716.63
7.2.60.0060.00616.73
7.2.00.0090.00619.53
7.1.200.0090.00615.42
7.1.100.0190.00318.00
7.1.70.0080.00016.87
7.1.60.0030.00919.25
7.1.50.0070.01416.76
7.1.00.0030.07322.51
7.0.200.0070.00016.77
7.0.140.0000.07722.09
7.0.60.0130.07019.90
7.0.50.0100.08317.98
7.0.40.0000.04720.24
7.0.30.0300.06720.24
7.0.20.0230.05320.16
7.0.10.0270.06020.20
7.0.00.0130.08020.22
5.6.280.0070.07020.90
5.6.210.0030.07020.65
5.6.200.0100.04318.19
5.6.190.0000.08320.42
5.6.180.0330.07020.66
5.6.170.0430.06720.54
5.6.160.0070.08720.55
5.6.150.0100.08318.25
5.6.140.0030.04318.14
5.6.130.0030.08718.18
5.6.120.0030.05721.06
5.6.110.0030.04321.05
5.6.100.0070.03721.09
5.6.90.0030.08720.98
5.6.80.0070.07320.41
5.6.70.0270.06320.38
5.5.350.0300.07720.33
5.5.340.0100.07718.02
5.5.330.0000.07720.30
5.5.320.0130.07020.44
5.5.310.0300.06720.43
5.5.300.0130.06717.99
5.5.290.0100.07717.95
5.5.280.0070.03720.78
5.5.270.0130.08020.78
5.5.260.0000.08720.68
5.5.250.0070.07720.69
5.5.240.0100.05020.28
5.4.450.0670.04019.17
5.4.440.1530.03719.55
5.4.430.1200.03319.41
5.4.420.0070.06319.32
5.4.410.0030.06019.03
5.4.400.0370.05718.87
5.4.390.0530.05718.57
5.4.380.0230.06018.75
5.4.370.0000.04718.70
5.4.360.0170.04318.86
5.4.350.0060.03412.02
5.4.340.0100.03512.02
5.4.320.0020.04212.50
5.4.310.0060.03712.50
5.4.300.0030.04012.51
5.4.290.0060.03812.50
5.4.280.0070.03512.40
5.4.270.0040.03812.40
5.4.260.0090.03812.40
5.4.250.0040.04412.40
5.4.240.0050.03712.39
5.4.230.0070.04112.39
5.4.220.0040.03812.39
5.4.210.0060.03912.39
5.4.200.0050.04712.39
5.4.190.0080.04012.38
5.4.180.0070.03512.39
5.4.170.0060.03712.40
5.4.160.0010.04112.39
5.4.150.0100.04012.39
5.4.140.0040.03712.07
5.4.130.0060.03412.06
5.4.120.0060.03512.02
5.4.110.0050.03512.02
5.4.100.0030.03712.02
5.4.90.0040.03912.02
5.4.80.0050.03712.02
5.4.70.0040.03812.01
5.4.60.0040.03612.02
5.4.50.0080.03412.01
5.4.40.0070.03312.00
5.4.30.0040.03712.00
5.4.20.0050.03612.00
5.4.10.0060.03412.00
5.4.00.0030.03811.49
5.3.290.0050.04012.80
5.3.280.0060.03712.71
5.3.270.0040.04112.72
5.3.260.0080.03812.72
5.3.250.0080.04912.71
5.3.240.0080.03612.72
5.3.230.0090.03512.70
5.3.220.0060.03712.68
5.3.210.0060.03912.68
5.3.200.0050.03712.68
5.3.190.0070.03612.68
5.3.180.0070.03812.68
5.3.170.0070.03712.67
5.3.160.0050.03912.67
5.3.150.0060.03812.67
5.3.140.0060.03712.66
5.3.130.0040.04612.66
5.3.120.0070.03812.66
5.3.110.0060.03912.66
5.3.100.0060.03812.13
5.3.90.0070.03612.11
5.3.80.0050.03912.11
5.3.70.0100.03812.10
5.3.60.0070.03712.09
5.3.50.0110.04312.04
5.3.40.0070.03512.04
5.3.30.0070.03412.00
5.3.20.0040.03811.77
5.3.10.0050.03611.74
5.3.00.0040.03911.73
5.2.170.0080.0279.23
5.2.160.0060.0299.23
5.2.150.0090.0279.23
5.2.140.0050.0309.23
5.2.130.0050.0299.19
5.2.120.0060.0279.19
5.2.110.0030.0319.19
5.2.100.0040.0299.19
5.2.90.0070.0319.19
5.2.80.0060.0299.19
5.2.70.0050.0319.18
5.2.60.0050.0319.14
5.2.50.0070.0289.11
5.2.40.0030.0309.09
5.2.30.0050.0309.06
5.2.20.0060.0289.05
5.2.10.0050.0278.95
5.2.00.0050.0288.82
5.1.60.0020.0268.10
5.1.50.0030.0268.10
5.1.40.0040.0248.08
5.1.30.0050.0258.43
5.1.20.0020.0298.45
5.1.10.0050.0258.17
5.1.00.0030.0268.18
5.0.50.0050.0186.65
5.0.40.0000.0226.52
5.0.30.0020.0326.32
5.0.20.0020.0206.29
5.0.10.0040.0186.27
5.0.00.0020.0316.27
4.4.90.0000.0184.78
4.4.80.0020.0164.75
4.4.70.0020.0164.75
4.4.60.0000.0174.75
4.4.50.0040.0134.77
4.4.40.0010.0264.70
4.4.30.0040.0134.76
4.4.20.0010.0174.85
4.4.10.0010.0174.85
4.4.00.0030.0244.76
4.3.110.0000.0184.67
4.3.100.0030.0154.66
4.3.90.0030.0144.63
4.3.80.0030.0234.59
4.3.70.0010.0174.63
4.3.60.0030.0134.63
4.3.50.0040.0144.63
4.3.40.0050.0214.54
4.3.30.0010.0173.30
4.3.20.0010.0173.28
4.3.10.0010.0163.24
4.3.00.0370.02015.25

preferences:
57.82 ms | 400 KiB | 5 Q