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}}</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.00416.75
8.3.50.0050.01022.24
8.3.40.0100.00719.09
8.3.30.0150.00019.04
8.3.20.0040.00420.20
8.3.10.0080.00021.90
8.3.00.0060.00317.93
8.2.180.0190.00316.63
8.2.170.0130.00722.96
8.2.160.0000.01420.35
8.2.150.0000.00824.18
8.2.140.0040.01124.66
8.2.130.0080.00026.16
8.2.120.0190.00021.08
8.2.110.0030.00622.33
8.2.100.0040.00819.70
8.2.90.0050.00319.35
8.2.80.0030.00717.97
8.2.70.0100.00017.75
8.2.60.0060.00618.04
8.2.50.0040.00718.07
8.2.40.0000.00818.16
8.2.30.0040.00418.35
8.2.20.0000.00817.82
8.2.10.0000.00718.07
8.2.00.0000.00817.77
8.1.280.0120.01225.92
8.1.270.0040.00423.84
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0000.00823.84
8.1.230.0000.01119.07
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0060.00317.48
8.1.190.0040.00417.48
8.1.180.0030.00618.10
8.1.170.0080.00018.59
8.1.160.0000.00822.07
8.1.150.0050.00318.91
8.1.140.0040.00417.60
8.1.130.0000.00717.86
8.1.120.0040.00417.59
8.1.110.0070.00017.55
8.1.100.0040.00417.50
8.1.90.0070.00017.58
8.1.80.0040.00417.55
8.1.70.0030.00517.61
8.1.60.0060.00317.77
8.1.50.0050.00317.74
8.1.40.0040.00417.64
8.1.30.0040.00417.68
8.1.20.0040.00417.85
8.1.10.0040.00417.66
8.1.00.0000.00817.61
8.0.300.0000.00818.77
8.0.290.0000.00716.88
8.0.280.0030.00518.48
8.0.270.0040.00417.35
8.0.260.0000.00717.27
8.0.250.0050.00317.00
8.0.240.0000.00717.17
8.0.230.0070.00017.03
8.0.220.0000.00717.09
8.0.210.0070.00016.94
8.0.200.0000.00716.97
8.0.190.0040.00417.07
8.0.180.0000.00717.08
8.0.170.0000.00817.07
8.0.160.0040.00417.02
8.0.150.0000.00816.87
8.0.140.0050.00216.98
8.0.130.0000.00613.43
8.0.120.0080.00017.03
8.0.110.0040.00417.02
8.0.100.0050.00216.90
8.0.90.0050.00317.10
8.0.80.0070.00716.92
8.0.70.0000.00716.95
8.0.60.0040.00416.86
8.0.50.0000.00816.92
8.0.30.0170.00817.28
8.0.20.0140.00717.50
8.0.10.0020.00516.97
8.0.00.0140.00516.94
7.4.330.0050.00015.11
7.4.320.0030.00316.73
7.4.300.0060.00016.83
7.4.290.0090.00016.70
7.4.280.0030.00716.81
7.4.270.0000.00816.86
7.4.260.0070.00016.79
7.4.250.0040.00416.68
7.4.240.0040.00416.73
7.4.230.0000.00716.84
7.4.220.0040.01516.76
7.4.210.0070.00716.85
7.4.200.0040.00416.84
7.4.160.0100.00616.61
7.4.150.0130.00417.40
7.4.140.0110.00617.86
7.4.130.0100.00816.81
7.4.120.0090.00816.76
7.4.110.0130.00716.68
7.4.100.0090.01216.83
7.4.90.0080.00816.81
7.4.80.0170.00719.39
7.4.70.0090.00916.73
7.4.60.0100.01016.67
7.4.50.0000.00516.69
7.4.40.0130.00316.81
7.4.30.0090.00616.75
7.4.10.0090.01015.21
7.4.00.0060.01114.97
7.3.330.0000.00613.51
7.3.320.0020.00213.38
7.3.310.0000.00716.44
7.3.300.0000.00716.57
7.3.290.0090.00616.44
7.3.280.0080.00916.52
7.3.270.0070.01117.40
7.3.260.0100.01416.49
7.3.250.0120.00816.74
7.3.240.0100.00816.51
7.3.230.0130.00316.76
7.3.210.0090.00916.40
7.3.200.0160.00619.39
7.3.190.0130.01016.81
7.3.180.0070.01116.48
7.3.170.0100.00616.80
7.3.160.0080.00816.89
7.3.130.0100.00715.15
7.3.120.0070.00815.05
7.3.110.0000.01914.80
7.3.100.0000.01414.85
7.3.90.0120.00314.66
7.3.80.0040.01115.16
7.3.70.0070.01015.09
7.3.60.0110.00314.84
7.3.50.0040.00715.04
7.3.40.0080.00314.82
7.3.30.0070.00714.95
7.3.20.0030.01016.94
7.3.10.0050.00616.77
7.3.00.0090.00716.81
7.2.330.0100.01417.00
7.2.320.0120.00616.77
7.2.310.0070.01016.91
7.2.300.0130.00616.89
7.2.290.0000.02516.96
7.2.260.0130.00615.32
7.2.250.0030.00915.23
7.2.240.0110.00415.48
7.2.230.0100.00315.30
7.2.220.0130.00315.31
7.2.210.0090.00315.32
7.2.200.0040.01215.45
7.2.190.0080.00815.27
7.2.180.0040.00715.42
7.2.170.0060.00315.32
7.2.160.0100.00715.30
7.2.150.0000.01417.23
7.2.140.0080.00817.17
7.2.130.0080.00917.12
7.2.120.0110.00517.11
7.2.110.0090.00417.05
7.2.100.0040.01117.02
7.2.90.0030.01117.03
7.2.80.0070.00817.13
7.2.70.0060.00817.12
7.2.60.0060.01016.93
7.2.50.0070.00916.91
7.2.40.0080.00516.97
7.2.30.0080.00716.93
7.2.20.0060.00617.07
7.2.10.0050.01017.18
7.2.00.0060.00618.01
7.1.330.0110.00315.86
7.1.320.0060.00615.67
7.1.310.0030.01015.95
7.1.300.0040.01115.64
7.1.290.0030.01016.10
7.1.280.0070.01015.74
7.1.270.0110.00415.89
7.1.260.0080.00316.02
7.1.250.0050.00915.65
7.1.240.0040.01215.70
7.1.230.0070.01015.51
7.1.220.0070.00715.94
7.1.210.0070.00716.17
7.1.200.0070.00416.09
7.1.190.0070.01015.93
7.1.180.0040.00816.04
7.1.170.0030.00615.85
7.1.160.0000.01115.93
7.1.150.0100.00715.64
7.1.140.0130.00015.88
7.1.130.0110.00015.78
7.1.120.0060.00915.57
7.1.110.0070.01015.82
7.1.100.0030.01017.13
7.1.90.0150.00016.07
7.1.80.0030.00916.01
7.1.70.0020.00916.66
7.1.60.0090.00417.68
7.1.50.0030.01216.47
7.1.40.0030.01416.10
7.1.30.0000.00915.82
7.1.20.0080.00615.99
7.1.10.0030.00616.04
7.1.00.0090.03519.05
7.0.330.0040.00815.40
7.0.320.0070.00715.45
7.0.310.0000.01415.55
7.0.300.0060.00315.02
7.0.290.0070.00315.57
7.0.280.0100.00315.37
7.0.270.0120.00315.11
7.0.260.0050.00815.41
7.0.250.0100.00315.70
7.0.240.0100.00315.61
7.0.230.0030.00715.50
7.0.220.0000.01315.60
7.0.210.0040.00815.34
7.0.200.0030.00616.26
7.0.190.0040.01115.64
7.0.180.0030.01315.53
7.0.170.0060.00915.75
7.0.160.0000.00815.61
7.0.150.0000.01115.67
7.0.140.0020.04218.82
7.0.130.0000.01615.64
7.0.120.0030.00715.66
7.0.110.0040.00415.52
7.0.100.0060.00615.65
7.0.90.0030.01015.82
7.0.80.0060.00615.77
7.0.70.0000.00815.70
7.0.60.0050.04217.83
7.0.50.0100.02716.83
7.0.40.0020.02716.88
7.0.30.0150.04316.82
7.0.20.0170.03116.90
7.0.10.0060.03616.84
7.0.00.0080.04316.92
5.6.400.0000.01014.66
5.6.390.0070.00714.43
5.6.380.0040.00714.75
5.6.370.0080.00614.83
5.6.360.0050.00614.40
5.6.350.0110.00714.25
5.6.340.0030.00714.34
5.6.330.0040.00714.43
5.6.320.0080.00814.59
5.6.310.0040.00814.77
5.6.300.0080.00814.38
5.6.290.0040.00814.41
5.6.280.0050.04017.68
5.6.270.0030.00914.53
5.6.260.0070.00714.42
5.6.250.0040.00814.51
5.6.240.0110.00414.86
5.6.230.0060.00914.63
5.6.220.0030.00914.59
5.6.210.0090.04317.56
5.6.200.0070.03216.42
5.6.190.0100.02217.59
5.6.180.0130.03817.52
5.6.170.0170.04217.45
5.6.160.0050.03217.58
5.6.150.0030.04616.44
5.6.140.0060.04016.49
5.6.130.0060.03216.38
5.6.120.0030.02417.77
5.6.110.0000.03017.93
5.6.100.0070.04717.67
5.6.90.0050.02617.79
5.6.80.0070.04217.55
5.6.70.0070.00714.65
5.6.60.0040.01114.55
5.6.50.0110.00314.75
5.6.40.0040.01114.63
5.6.30.0000.00914.53
5.6.20.0030.01214.29
5.6.10.0110.00314.35
5.6.00.0030.01014.59
5.5.380.0070.00714.68
5.5.370.0080.00314.73
5.5.360.0060.00614.20
5.5.350.0060.03017.42
5.5.340.0080.04316.33
5.5.330.0100.02317.37
5.5.320.0070.03917.50
5.5.310.0180.04217.56
5.5.300.0050.02316.04
5.5.290.0060.04816.25
5.5.280.0100.02917.88
5.5.270.0050.02617.71
5.5.260.0150.03317.75
5.5.250.0130.03517.61
5.5.240.0160.03817.39
5.5.230.0000.01614.42
5.5.220.0090.00614.65
5.5.210.0100.00314.59
5.5.200.0070.00714.13
5.5.190.0110.00014.45
5.5.180.0030.01314.49
5.5.170.0090.00614.67
5.5.160.0060.00614.49
5.5.150.0100.00014.20
5.5.140.0030.00914.61
5.5.130.0100.00714.43
5.5.120.0000.01414.49
5.5.110.0070.00714.42
5.5.100.0070.00714.50
5.5.90.0120.00014.09
5.5.80.0070.00314.59
5.5.70.0030.01414.44
5.5.60.0040.01114.23
5.5.50.0040.00814.43
5.5.40.0040.01114.45
5.5.30.0080.00614.14
5.5.20.0050.00814.32
5.5.10.0040.01414.30
5.5.00.0120.00414.27
5.4.450.0750.02515.55
5.4.440.0820.02715.43
5.4.430.0470.02715.46
5.4.420.0520.02015.22
5.4.410.0310.02015.21
5.4.400.0060.01715.09
5.4.390.0440.02715.15
5.4.380.0280.03914.76
5.4.370.0450.03214.73
5.4.360.0480.03014.78
5.4.350.0480.03315.04
5.4.340.0560.03514.96
5.4.330.0060.00311.17
5.4.320.0030.02411.75
5.4.310.0040.02411.91
5.4.300.0080.02111.98
5.4.290.0050.02411.76
5.4.280.0050.02111.69
5.4.270.0060.02011.72
5.4.260.0050.02311.76
5.4.250.0080.02111.87
5.4.240.0070.01911.79
5.4.230.0050.02111.72
5.4.220.0050.02311.80
5.4.210.0050.02011.67
5.4.200.0080.02211.92
5.4.190.0090.02211.76
5.4.180.0020.02511.69
5.4.170.0090.01911.76
5.4.160.0090.01911.78
5.4.150.0040.02411.86
5.4.140.0050.02211.71
5.4.130.0060.02311.69
5.4.120.0020.02311.65
5.4.110.0060.02011.54
5.4.100.0060.02011.78
5.4.90.0040.02411.76
5.4.80.0050.02911.75
5.4.70.0060.02011.53
5.4.60.0060.02011.70
5.4.50.0060.01911.59
5.4.40.0030.02211.68
5.4.30.0070.01811.50
5.4.20.0080.01911.51
5.4.10.0060.02011.63
5.4.00.0060.02011.45
5.3.290.0030.02311.72
5.3.280.0050.02311.74
5.3.270.0090.01811.75
5.3.260.0060.02111.67
5.3.250.0060.02111.67
5.3.240.0050.02211.53
5.3.230.0090.01811.58
5.3.220.0020.02311.47
5.3.210.0040.02411.54
5.3.200.0060.02111.73
5.3.190.0050.02111.62
5.3.180.0070.02011.76
5.3.170.0060.02111.74
5.3.160.0060.02111.72
5.3.150.0040.02811.62
5.3.140.0060.02011.62
5.3.130.0020.02511.55
5.3.120.0060.02211.62
5.3.110.0070.02011.61
5.3.100.0040.02411.41
5.3.90.0080.01911.44
5.3.80.0070.02011.43
5.3.70.0050.01911.35
5.3.60.0030.02211.35
5.3.50.0020.02611.33
5.3.40.0060.01911.33
5.3.30.0040.02211.19
5.3.20.0040.02111.20
5.3.10.0020.02311.02
5.3.00.0070.02111.09
5.2.170.0030.0339.24
5.2.160.0040.0309.24
5.2.150.0050.0309.24
5.2.140.0060.0299.23
5.2.130.0060.0279.20
5.2.120.0080.0269.20
5.2.110.0060.0299.21
5.2.100.0030.0319.20
5.2.90.0050.0299.20
5.2.80.0040.0319.20
5.2.70.0080.0279.19
5.2.60.0040.0319.14
5.2.50.0050.0319.11
5.2.40.0030.0319.09
5.2.30.0080.0389.07
5.2.20.0050.0289.05
5.2.10.0040.0368.95
5.2.00.0060.0288.82
5.1.60.0040.0248.10
5.1.50.0040.0258.09
5.1.40.0030.0268.07
5.1.30.0060.0248.42
5.1.20.0070.0248.45
5.1.10.0050.0258.17
5.1.00.0010.0298.17
5.0.50.0060.0186.65
5.0.40.0070.0236.51
5.0.30.0080.0276.32
5.0.20.0040.0196.29
5.0.10.0010.0226.27
5.0.00.0020.0326.26
4.4.90.0050.0134.78
4.4.80.0020.0164.75
4.4.70.0040.0154.76
4.4.60.0040.0154.76
4.4.50.0020.0174.77
4.4.40.0050.0234.71
4.4.30.0030.0164.76
4.4.20.0040.0144.84
4.4.10.0030.0174.85
4.4.00.0040.0244.76
4.3.110.0020.0194.67
4.3.100.0020.0164.67
4.3.90.0040.0194.63
4.3.80.0030.0254.59
4.3.70.0060.0124.63
4.3.60.0020.0164.62
4.3.50.0050.0134.63
4.3.40.0010.0254.54
4.3.30.0020.0163.30
4.3.20.0030.0153.28
4.3.10.0010.0163.23
4.3.00.0370.01315.25

preferences:
43.24 ms | 401 KiB | 5 Q