3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class HTMLDecorator { /** @var \ArrayObject */ protected $notes; public function format(){ $html = ''; foreach ($this->getNodes() as $node) $html .= "<p>{$node}</p>"; return $html; } } class HTML extends HTMLDecorator{ public function __construct(){ $this->nodes = new \ArrayObject(); } public function getNodes(){ return $this->nodes; } } class BlockHtml extends HTMLDecorator{ protected $html; public function __construct(HTMLDecorator $html){ $this->html = $html; } public function getNodes() { $this->html->getNodes()->append('Block html'); return $this->html->getNodes(); } } class ImageHtml extends HTMLDecorator{ protected $html; public function __construct(HTMLDecorator $html){ $this->html = $html; } public function getNodes() { $this->html->getNodes()->append('Image html'); return $this->html->getNodes(); } } $html = new HTML(); $html = BlockHTML($html); $html = ImageHTML($html); echo $html->format();

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.0090.00618.18
8.3.50.0090.00922.05
8.3.40.0100.01019.09
8.3.30.0130.00319.13
8.3.20.0040.00420.30
8.3.10.0000.00921.92
8.3.00.0080.00022.52
8.2.180.0040.01516.63
8.2.170.0100.00322.96
8.2.160.0110.00420.82
8.2.150.0080.00024.18
8.2.140.0050.00524.66
8.2.130.0090.00926.16
8.2.120.0080.00017.63
8.2.110.0040.00422.19
8.2.100.0060.00619.45
8.2.90.0050.00319.09
8.2.80.0060.00318.03
8.2.70.0000.00817.63
8.2.60.0050.00317.78
8.2.50.0040.00418.07
8.2.40.0000.00818.09
8.2.30.0060.00318.03
8.2.20.0050.00217.53
8.2.10.0040.00417.58
8.2.00.0020.00517.55
8.1.280.0100.01025.92
8.1.270.0000.00822.02
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0090.00023.82
8.1.230.0080.00419.05
8.1.220.0040.00417.77
8.1.210.0030.00518.77
8.1.200.0090.00017.35
8.1.190.0040.00417.52
8.1.180.0040.00418.71
8.1.170.0050.00318.54
8.1.160.0000.00722.00
8.1.150.0040.00418.57
8.1.140.0040.00417.41
8.1.130.0030.00317.74
8.1.120.0030.00317.48
8.1.110.0030.00617.28
8.1.100.0030.00417.29
8.1.90.0000.00717.39
8.1.80.0040.00417.41
8.1.70.0040.00417.32
8.1.60.0140.00017.59
8.1.50.0080.00017.41
8.1.40.0080.00017.54
8.1.30.0030.00617.59
8.1.20.0030.00517.54
8.1.10.0030.00617.46
8.1.00.0080.00017.51
8.0.300.0070.00018.77
8.0.290.0070.00017.05
8.0.280.0070.00018.27
8.0.270.0000.00717.22
8.0.260.0000.00616.69
8.0.250.0000.00716.86
8.0.240.0020.00516.98
8.0.230.0070.00016.94
8.0.220.0030.00316.88
8.0.210.0030.00316.91
8.0.200.0000.00716.93
8.0.190.0040.00416.86
8.0.180.0040.00416.90
8.0.170.0030.00516.88
8.0.160.0000.00816.82
8.0.150.0070.00416.76
8.0.140.0000.00716.89
8.0.130.0060.00013.31
8.0.120.0050.00316.83
8.0.110.0000.00816.77
8.0.100.0020.00516.93
8.0.90.0080.00016.84
8.0.80.0070.01316.93
8.0.70.0030.00616.71
8.0.60.0000.00716.88
8.0.50.0000.00816.84
8.0.30.0100.01317.13
8.0.20.0110.00617.40
8.0.10.0000.00716.81
8.0.00.0070.01116.59
7.4.330.0020.00215.00
7.4.320.0030.00316.53
7.4.300.0030.00316.55
7.4.290.0000.00716.48
7.4.280.0000.00716.62
7.4.270.0000.00716.51
7.4.260.0080.00316.53
7.4.250.0040.00416.48
7.4.240.0060.00116.51
7.4.230.0070.00016.60
7.4.220.0160.00616.54
7.4.210.0070.00716.49
7.4.200.0070.00016.42
7.4.190.0050.00216.40
7.4.160.0060.01016.46
7.4.150.0150.00317.40
7.4.140.0100.00717.86
7.4.130.0120.00716.49
7.4.120.0090.00916.58
7.4.110.0110.00716.46
7.4.100.0060.01216.51
7.4.90.0070.01116.49
7.4.80.0120.00819.39
7.4.70.0100.00716.43
7.4.60.0100.00816.69
7.4.50.0060.00316.43
7.4.40.0070.01122.77
7.4.30.0130.00316.56
7.4.00.0090.00314.97
7.3.330.0050.00613.19
7.3.320.0050.00013.18
7.3.310.0040.00416.18
7.3.300.0000.00616.33
7.3.290.0080.01216.35
7.3.280.0060.01016.36
7.3.270.0100.00717.40
7.3.260.0150.00316.39
7.3.250.0090.00916.45
7.3.240.0130.01016.55
7.3.230.0130.00316.39
7.3.210.0000.01716.36
7.3.200.0060.01019.39
7.3.190.0090.01016.58
7.3.180.0160.00316.33
7.3.170.0090.01216.41
7.3.160.0080.00816.27
7.3.120.0080.01014.91
7.3.110.0100.00614.95
7.3.100.0040.01214.88
7.3.90.0040.00815.04
7.3.80.0100.00314.70
7.3.70.0060.00914.59
7.3.60.0130.00314.86
7.3.50.0000.01314.63
7.3.40.0110.00414.72
7.3.30.0030.01014.95
7.3.20.0090.00616.65
7.3.10.0030.00616.69
7.3.00.0000.01016.59
7.2.330.0110.00716.66
7.2.320.0060.01216.43
7.2.310.0000.01716.53
7.2.300.0060.01016.37
7.2.290.0060.01116.67
7.2.250.0070.01015.21
7.2.240.0060.01314.89
7.2.230.0100.00614.93
7.2.220.0030.00914.86
7.2.210.0060.00914.89
7.2.200.0050.00514.83
7.2.190.0090.00314.94
7.2.180.0030.01315.16
7.2.170.0030.00914.85
7.2.80.0040.00716.47
7.2.60.0050.00816.72
7.2.00.0000.01219.50
7.1.330.0030.01015.77
7.1.320.0090.00315.52
7.1.310.0000.00815.61
7.1.300.0040.01115.72
7.1.290.0090.00615.68
7.1.280.0130.00315.79
7.1.270.0060.00915.77
7.1.260.0060.00915.70
7.1.200.0000.00615.65
7.1.100.0030.01217.98
7.1.70.0050.00317.04
7.1.60.0100.01319.82
7.1.50.0070.01616.79
7.1.00.0100.07022.32
7.0.200.0060.00616.59
7.0.140.0070.06722.18
7.0.100.0370.06319.89
7.0.90.0100.07319.91
7.0.80.0230.06019.93
7.0.70.0170.07319.88
7.0.60.0100.08019.91
7.0.50.0000.08020.25
7.0.40.0070.06020.02
7.0.30.0130.04720.00
7.0.20.0070.08020.05
7.0.10.0100.08020.09
7.0.00.0070.08320.05
5.6.280.0000.07721.09
5.6.250.0070.04720.73
5.6.240.0200.07320.54
5.6.230.0000.08320.52
5.6.220.0130.06320.64
5.6.210.0100.08320.46
5.6.200.0100.07721.06
5.6.190.0070.08320.99
5.6.180.0130.07021.10
5.6.170.0030.06320.93
5.6.160.0100.07720.98
5.6.150.0100.08021.07
5.6.140.0070.08320.93
5.6.130.0100.08720.93
5.6.120.0100.06020.99
5.6.110.0000.04720.94
5.6.100.0130.07020.94
5.6.90.0170.07321.03
5.6.80.0030.05020.37
5.6.70.0030.04020.37
5.6.60.0070.03720.38
5.6.50.0070.03720.29
5.6.40.0030.04020.38
5.6.30.0070.04320.36
5.6.20.0100.07720.45
5.6.10.0030.03720.37
5.6.00.0070.05720.39
5.5.380.0030.07320.48
5.5.370.0070.04320.53
5.5.360.0000.08020.32
5.5.350.0030.07020.34
5.5.340.0100.07720.86
5.5.330.0030.05320.85
5.5.320.0100.06020.89
5.5.310.0070.05720.74
5.5.300.0070.08020.75
5.5.290.0170.07020.88
5.5.280.0100.05720.73
5.5.270.0130.07720.88
5.5.260.0070.08320.75
5.5.250.0170.07320.42
5.5.240.0030.04020.00
5.5.230.0070.04720.27
5.5.220.0100.03320.24
5.5.210.0070.04320.26
5.5.200.0070.03720.03
5.5.190.0000.04720.18
5.5.180.0030.04320.09
5.5.160.0130.07020.15
5.5.150.0030.04320.08
5.5.140.0100.03720.18
5.5.130.0030.04320.13
5.5.120.0030.04319.95
5.5.110.0100.03020.17
5.5.100.0070.04020.08
5.5.90.0070.03719.92
5.5.80.0000.08320.01
5.5.70.0070.06320.04
5.5.60.0100.03320.00
5.5.50.0030.08020.11
5.5.40.0070.04720.03
5.5.30.0070.04019.91
5.5.20.0070.04020.02
5.5.10.0070.04720.02
5.5.00.0030.03719.93
5.4.450.0130.07719.54
5.4.440.0070.08019.21
5.4.430.0030.08319.50
5.4.420.0130.07719.37
5.4.410.0100.06319.29
5.4.400.0030.04319.09
5.4.390.0030.04018.85
5.4.380.0030.04319.14
5.4.370.0030.04319.17
5.4.360.0000.04319.15
5.4.350.0070.04019.17
5.4.340.0030.07019.11
5.4.320.0130.03018.93
5.4.310.0170.05318.99
5.4.300.0100.03719.18
5.4.290.0030.04319.13
5.4.280.0130.03319.11
5.4.270.0100.03719.22
5.4.260.0030.03719.04
5.4.250.0130.02319.15
5.4.240.0070.03319.02
5.4.230.0030.04319.00
5.4.220.0000.04319.02
5.4.210.0070.03318.88
5.4.200.0000.04019.10
5.4.190.0100.04319.12
5.4.180.0070.03319.13
5.4.170.0000.04019.13
5.4.160.0100.03019.10
5.4.150.0030.04019.00
5.4.140.0030.03716.47
5.4.130.0070.03316.34
5.4.120.0070.03016.43
5.4.110.0000.04016.57
5.4.100.0000.04716.52
5.4.90.0030.03016.36
5.4.80.0070.04016.43
5.4.70.0030.04716.35
5.4.60.0030.03716.44
5.4.50.0070.05016.44
5.4.40.0030.03716.39
5.4.30.0000.04016.37
5.4.20.0070.06716.24
5.4.10.0070.06016.25
5.4.00.0130.07015.81
5.3.290.0100.07014.75
5.3.280.0070.03314.75
5.3.270.0030.03714.61
5.3.260.0000.04714.73
5.3.250.0030.03714.55
5.3.240.0030.05714.74
5.3.230.0000.04014.75
5.3.220.0030.03714.57
5.3.210.0000.04014.57
5.3.200.0070.03314.56
5.3.190.0130.03714.59
5.3.180.0000.03714.56
5.3.170.0100.03014.70
5.3.160.0100.02714.72
5.3.150.0030.05714.69
5.3.140.0030.03714.60
5.3.130.0030.04014.49
5.3.120.0000.04014.54
5.3.110.0070.06714.70
5.3.100.0130.03714.07
5.3.90.0070.04013.97
5.3.80.0070.07314.18
5.3.70.0000.06014.17
5.3.60.0030.07014.00
5.3.50.0070.07313.86
5.3.40.0070.04713.90
5.3.30.0070.07013.87
5.3.20.0030.08013.62
5.3.10.0070.05313.73
5.3.00.0070.07313.64
5.2.170.0030.06011.26
5.2.160.0000.06711.07
5.2.150.0100.05711.03
5.2.140.0030.06311.28
5.2.130.0030.06011.24
5.2.120.0000.06311.26
5.2.110.0070.06011.15
5.2.100.0030.06311.14
5.2.90.0100.04011.03
5.2.80.0030.06311.25
5.2.70.0070.06011.20
5.2.60.0070.05711.05
5.2.50.0030.06711.09
5.2.40.0100.05011.04
5.2.30.0030.06310.98
5.2.20.0000.06310.99
5.2.10.0070.06010.89
5.2.00.0070.05710.87
5.1.60.0070.03010.13
5.1.50.0030.05710.03
5.1.40.0070.05310.09
5.1.30.0030.03310.35
5.1.20.0070.05710.30
5.1.10.0070.04710.09
5.1.00.0000.06010.16
5.0.50.0000.0508.66
5.0.40.0030.0438.55
5.0.30.0070.0508.13
5.0.20.0000.0278.11
5.0.10.0000.0478.30
5.0.00.0030.0638.19
4.4.90.0070.0308.07
4.4.80.0070.0408.07
4.4.70.0000.0338.07
4.4.60.0000.0238.07
4.4.50.0100.0208.07
4.4.40.0030.0408.02
4.4.30.0070.0308.02
4.4.20.0030.0308.02
4.4.10.0070.0338.02
4.4.00.0030.0538.02
4.3.110.0030.0338.02
4.3.100.0070.0238.02
4.3.90.0000.0378.02
4.3.80.0030.0538.02
4.3.70.0000.0278.02
4.3.60.0030.0338.02
4.3.50.0070.0308.02
4.3.40.0000.0478.02
4.3.30.0000.0378.02
4.3.20.0070.0308.02
4.3.10.0030.0338.02
4.3.00.0030.0338.02

preferences:
79.4 ms | 401 KiB | 5 Q