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'; 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.40.0100.00719.09
8.3.30.0090.00618.95
8.3.20.0070.00020.30
8.3.10.0050.00321.83
8.3.00.0080.00018.03
8.2.170.0100.01022.96
8.2.160.0030.01020.52
8.2.150.0050.00324.18
8.2.140.0170.00324.66
8.2.130.0050.00226.16
8.2.120.0040.00421.02
8.2.110.0100.00019.30
8.2.100.0090.00318.03
8.2.90.0000.00819.22
8.2.80.0050.00317.97
8.2.70.0040.00417.75
8.2.60.0030.00618.03
8.2.50.0000.00918.07
8.2.40.0080.00017.91
8.2.30.0040.00418.25
8.2.20.0050.00317.95
8.2.10.0040.00418.22
8.2.00.0050.00317.98
8.1.270.0080.00023.80
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0030.00621.19
8.1.230.0060.00617.70
8.1.220.0030.00517.74
8.1.210.0000.00818.77
8.1.200.0060.00317.36
8.1.190.0000.00817.48
8.1.180.0000.00818.10
8.1.170.0080.00018.81
8.1.160.0000.00822.04
8.1.150.0030.00518.89
8.1.140.0040.00417.61
8.1.130.0030.00317.76
8.1.120.0000.00717.60
8.1.110.0000.00717.65
8.1.100.0070.00017.63
8.1.90.0070.00017.52
8.1.80.0040.00417.58
8.1.70.0030.00317.49
8.1.60.0030.00617.79
8.1.50.0050.00317.67
8.1.40.0090.00017.57
8.1.30.0030.00517.88
8.1.20.0050.00317.72
8.1.10.0040.00417.69
8.1.00.0060.00317.55
8.0.300.0000.00718.77
8.0.290.0020.00516.75
8.0.280.0070.00018.48
8.0.270.0000.00717.33
8.0.260.0000.00717.19
8.0.250.0000.00717.12
8.0.240.0060.00317.05
8.0.230.0040.00417.15
8.0.220.0030.00317.02
8.0.210.0000.00716.93
8.0.200.0030.00317.12
8.0.190.0040.00416.98
8.0.180.0040.00416.96
8.0.170.0000.00716.97
8.0.160.0030.00316.92
8.0.150.0080.00016.86
8.0.140.0050.00216.88
8.0.130.0000.00513.43
8.0.120.0080.00017.02
8.0.110.0100.00016.96
8.0.100.0040.00416.92
8.0.90.0040.00416.82
8.0.80.0040.01717.00
8.0.70.0040.00417.16
8.0.60.0000.00716.93
8.0.50.0080.00017.11
8.0.30.0130.01217.18
8.0.20.0130.00817.46
8.0.10.0040.00417.22
8.0.00.0090.00916.90
7.4.330.0000.00515.10
7.4.320.0000.00616.78
7.4.300.0040.00416.77
7.4.290.0000.00716.73
7.4.280.0090.00016.82
7.4.270.0040.00416.82
7.4.260.0030.00516.80
7.4.250.0040.00416.80
7.4.240.0050.00216.76
7.4.230.0030.00316.64
7.4.220.0160.00716.85
7.4.210.0140.00016.91
7.4.200.0000.00816.80
7.4.160.0030.01316.80
7.4.150.0150.00317.40
7.4.140.0130.00517.86
7.4.130.0040.01216.57
7.4.120.0100.00816.63
7.4.110.0150.00316.86
7.4.100.0090.01216.57
7.4.90.0050.01716.73
7.4.80.0080.01419.39
7.4.70.0100.00616.72
7.4.60.0060.01216.79
7.4.50.0040.00416.50
7.4.40.0100.00616.91
7.4.30.0040.01216.79
7.4.00.0000.01515.21
7.3.330.0060.00013.52
7.3.320.0030.00313.52
7.3.310.0000.00716.58
7.3.300.0070.00016.52
7.3.290.0030.01116.66
7.3.280.0090.01016.54
7.3.270.0140.00417.40
7.3.260.0090.01216.51
7.3.250.0060.01116.67
7.3.240.0130.01016.55
7.3.230.0080.00816.57
7.3.210.0110.00716.52
7.3.200.0070.01119.39
7.3.190.0140.00316.58
7.3.180.0130.00316.62
7.3.170.0100.00716.67
7.3.160.0060.00916.80
7.3.120.0030.00815.37
7.2.330.0110.00716.71
7.2.320.0120.01216.93
7.2.310.0070.01016.79
7.2.300.0100.01416.94
7.2.290.0110.00916.87
7.2.00.0000.01619.70
7.1.100.0000.01318.25
7.1.70.0040.00417.45
7.1.60.0120.00619.25
7.1.50.0100.01317.14
7.1.00.0030.07722.29
7.0.200.0070.00316.96
7.0.140.0100.06722.21
7.0.60.0030.05019.87
7.0.50.0070.03717.89
7.0.40.0130.08020.27
7.0.30.0200.04320.32
7.0.20.0300.08020.22
7.0.10.0300.07720.10
7.0.00.0070.04020.21
5.6.280.0000.07720.83
5.6.210.0100.06020.63
5.6.200.0130.08018.18
5.6.190.0000.04720.47
5.6.180.0030.04720.49
5.6.170.0300.07020.47
5.6.160.0130.08020.46
5.6.150.0200.04018.14
5.6.140.0070.03718.18
5.6.130.0030.05018.24
5.6.120.0130.08021.04
5.6.110.0070.04320.89
5.6.100.0030.07721.13
5.6.90.0130.07320.96
5.6.80.0030.04720.54
5.6.70.0270.07320.41
5.5.350.0300.07020.39
5.5.340.0130.04317.98
5.5.330.0170.07020.42
5.5.320.0070.08320.43
5.5.310.0300.06720.27
5.5.300.0030.04318.01
5.5.290.0000.05318.06
5.5.280.0070.08720.66
5.5.270.0030.04720.84
5.5.260.0030.09020.77
5.5.250.0030.07720.59
5.5.240.0130.07320.16
5.4.450.2270.04319.63
5.4.440.2500.03719.52
5.4.430.2370.04019.54
5.4.420.0000.08019.56
5.4.410.0000.04719.43
5.4.400.0830.06719.23
5.4.390.2370.04018.89
5.4.380.2270.04018.99
5.4.370.2370.03319.08
5.4.360.1030.04019.09
5.4.350.2500.03318.95
5.4.340.2500.04019.07
5.4.320.1070.04719.09
5.4.310.0100.03719.20
5.4.300.0000.04019.21
5.4.290.1730.03718.87
5.4.280.0200.04019.08
5.4.270.0170.04019.02
5.4.260.0370.03719.14
5.4.250.0170.03719.13
5.4.240.0170.03719.30
5.4.230.0230.03319.17
5.4.220.0200.03318.99
5.4.210.0100.04719.30
5.4.200.0170.03719.20
5.4.190.0130.04319.18
5.4.180.0200.03718.97
5.4.170.0230.04019.15
5.4.160.0130.04319.14
5.4.150.0200.03719.29
5.4.140.0100.04316.34
5.4.130.0130.04016.33
5.4.120.0370.03316.51
5.4.110.0130.03716.29
5.4.100.0170.04316.56
5.4.90.0170.04016.45
5.4.80.0430.06316.57
5.4.70.0200.05016.57
5.4.60.0330.04316.49
5.4.50.0270.03316.26
5.4.40.0230.03016.53
5.4.30.0330.03316.16
5.4.20.0200.03316.16
5.4.10.0130.04016.34
5.4.00.0230.03715.78
5.3.290.0170.04014.59
5.3.280.0130.04314.51
5.3.270.0170.04014.59
5.3.260.0170.03714.63
5.3.250.0230.03014.66
5.3.240.0170.03714.52
5.3.230.0230.03014.52
5.3.220.0170.03714.48
5.3.210.0200.04314.62
5.3.200.0170.04314.62
5.3.190.0300.03314.49
5.3.180.0170.03714.68
5.3.170.0170.03714.57
5.3.160.0200.03314.61
5.3.150.0230.03014.54
5.3.140.0200.03314.65
5.3.130.0100.04314.56
5.3.120.0430.03714.63
5.3.110.0200.03714.53
5.3.100.0300.04314.05
5.3.90.0270.02713.93
5.3.80.0170.03713.95
5.3.70.0100.04314.14
5.3.60.0270.02714.16
5.3.50.0170.03713.96
5.3.40.0100.04313.86
5.3.30.0130.04013.92
5.3.20.0130.03713.62
5.3.10.0230.03013.80
5.3.00.0130.03713.55
5.2.170.0130.03311.05
5.2.160.0200.02311.24
5.2.150.0070.03711.06
5.2.140.0170.02711.27
5.2.130.0200.02011.04
5.2.120.0170.02711.02
5.2.110.0170.04011.16
5.2.100.0100.03711.03
5.2.90.0070.03311.28
5.2.80.0200.02311.19
5.2.70.0200.02311.19
5.2.60.0100.04011.21
5.2.50.0130.03011.00
5.2.40.0130.02711.23
5.2.30.0100.03010.90
5.2.20.0070.04711.05
5.2.10.0100.04310.77
5.2.00.0100.02710.79
5.1.60.0130.0279.93
5.1.50.0100.0279.99
5.1.40.0100.0239.97
5.1.30.0130.03710.57
5.1.20.0170.02710.58
5.1.10.0130.02310.16
5.1.00.0200.05010.23
5.0.50.0100.0309.04
5.0.40.0100.0379.04
5.0.30.0130.0609.04
5.0.20.0130.0409.04
5.0.10.0130.0409.04
5.0.00.0030.0339.04
4.4.90.0030.0179.04
4.4.80.0130.0109.04
4.4.70.0070.0179.04
4.4.60.0130.0309.04
4.4.50.0070.0239.04
4.4.40.0070.0479.04
4.4.30.0030.0209.04
4.4.20.0070.0179.04
4.4.10.0070.0179.04
4.4.00.0070.0339.04
4.3.110.0130.0239.04
4.3.100.0100.0309.04
4.3.90.0100.0209.04
4.3.80.0100.0239.04
4.3.70.0100.0139.04
4.3.60.0100.0309.04
4.3.50.0030.0209.04
4.3.40.0130.0339.04
4.3.30.0030.0209.04
4.3.20.0000.0209.04
4.3.10.0030.0179.04
4.3.00.0030.0139.04

preferences:
44.51 ms | 400 KiB | 5 Q