3v4l.org

run code in 300+ PHP versions simultaneously
<?php abstract class Component { protected $data; abstract public function getHtml(); } class ConcreteComponent extends Component { // public function __construct() // { // $this->data = "<body></body>"; // } public function getHtml() { // return $this->data; return "<body></body>"; } } abstract class Decorator extends Component { } class ConcreteDecorator1 extends Decorator { public function __construct(Component $data) { $this->data = $data; } public function getHtml() { return $this->data->getHtml() . "<p> </p>"; } } class ConcreteDecorator2 extends Decorator { public function __construct(Component $data) { $this->value = 500; $this->data = $data; } public function getHtml() { return "<span>".$this->data->getHtml()."</span>"; } } $compo = new ConcreteDecorator2(new ConcreteDecorator1(new ConcreteComponent())); echo $compo->getHtml(); // echo "Client:\t\t\t"; // echo $compo->getValue();

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.00717.00
8.3.50.0090.00616.50
8.3.40.0110.00418.78
8.3.30.0160.00018.97
8.3.20.0040.00420.38
8.3.10.0000.00823.39
8.3.00.0070.00317.90
8.2.180.0140.00016.50
8.2.170.0070.00722.96
8.2.160.0120.00620.45
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0070.00021.12
8.2.120.0070.00026.35
8.2.110.0090.00020.11
8.2.100.0110.00018.16
8.2.90.0000.00818.99
8.2.80.0080.00017.97
8.2.70.0030.00517.49
8.2.60.0050.00318.03
8.2.50.0040.00418.10
8.2.40.0000.00720.47
8.2.30.0000.00821.09
8.2.20.0050.00217.98
8.2.10.0030.00618.11
8.2.00.0000.00718.16
8.1.280.0090.00625.92
8.1.270.0070.00024.02
8.1.260.0050.00326.35
8.1.250.0000.00728.09
8.1.240.0040.00417.77
8.1.230.0110.00319.16
8.1.220.0000.00817.79
8.1.210.0050.00318.77
8.1.200.0000.00817.23
8.1.190.0030.00517.35
8.1.180.0040.00418.10
8.1.170.0000.00818.42
8.1.160.0000.00719.02
8.1.150.0040.00418.91
8.1.140.0000.00719.57
8.1.130.0000.00718.88
8.1.120.0040.00417.52
8.1.110.0040.00417.48
8.1.100.0000.00717.36
8.1.90.0050.00217.36
8.1.80.0000.00717.34
8.1.70.0090.00017.48
8.1.60.0060.00317.57
8.1.50.0000.00717.54
8.1.40.0040.00417.50
8.1.30.0040.00417.57
8.1.20.0030.00517.63
8.1.10.0020.00517.48
8.1.00.0070.00017.50
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0000.00718.47
8.0.270.0030.00317.13
8.0.260.0070.00016.79
8.0.250.0000.00717.04
8.0.240.0070.00016.97
8.0.230.0030.00316.93
8.0.220.0030.00516.93
8.0.210.0000.00816.81
8.0.200.0030.00316.88
8.0.190.0050.00317.00
8.0.180.0040.00416.84
8.0.170.0000.00717.01
8.0.160.0070.00016.85
8.0.150.0030.00616.89
8.0.140.0070.00016.80
8.0.130.0030.00313.45
8.0.120.0040.00416.86
8.0.110.0030.00516.78
8.0.100.0040.00416.93
8.0.90.0040.00416.97
8.0.80.0130.00316.90
8.0.70.0050.00216.98
8.0.60.0040.00416.95
8.0.50.0040.00417.00
8.0.30.0110.00717.21
8.0.20.0110.00817.40
8.0.10.0000.00716.86
8.0.00.0070.01016.59
7.4.330.0060.00015.55
7.4.320.0000.00716.55
7.4.300.0060.00016.52
7.4.290.0030.00616.51
7.4.280.0040.00416.58
7.4.270.0070.00016.36
7.4.260.0030.00313.23
7.4.250.0000.00716.48
7.4.240.0070.00016.50
7.4.230.0030.00316.70
7.4.220.0150.00916.61
7.4.210.0120.00316.48
7.4.200.0040.00416.63
7.4.160.0060.01116.52
7.4.150.0110.00717.40
7.4.140.0050.01317.86
7.4.130.0150.00416.55
7.4.120.0100.00816.46
7.4.110.0080.00816.64
7.4.100.0170.00716.71
7.4.90.0000.01816.63
7.4.80.0100.01319.39
7.4.70.0030.01316.35
7.4.60.0060.01216.54
7.4.50.0090.00616.65
7.4.40.0130.00916.39
7.4.30.0060.01016.49
7.4.00.0060.01214.87
7.3.330.0030.00313.27
7.3.320.0050.00013.17
7.3.310.0000.00716.37
7.3.300.0000.00616.14
7.3.290.0070.00916.37
7.3.280.0090.00816.33
7.3.270.0030.01517.40
7.3.260.0070.01116.52
7.3.250.0060.01216.45
7.3.240.0110.00616.42
7.3.230.0060.01616.56
7.3.210.0130.00316.38
7.3.200.0070.01016.45
7.3.190.0000.01516.30
7.3.180.0120.00316.38
7.3.170.0090.00616.42
7.3.160.0070.01016.58
7.2.330.0120.00816.89
7.2.320.0060.01216.49
7.2.310.0130.00316.42
7.2.300.0130.00916.79
7.2.290.0090.00916.68
7.2.60.0060.00916.66
7.2.00.0030.00619.23
7.1.200.0000.01015.57
7.1.100.0030.01018.21
7.1.70.0120.00615.16
7.1.60.0230.01332.99
7.1.50.0300.00532.80
7.1.40.0240.01032.27
7.1.30.0260.01132.53
7.1.20.0250.01032.56
7.1.10.0160.00314.61
7.1.00.0090.01214.88
7.0.200.0130.00614.90
7.0.190.0150.00414.98
7.0.180.0140.00714.52
7.0.170.0040.01414.61
7.0.160.0100.00714.42
7.0.150.0150.00314.36
7.0.140.0770.01014.48
7.0.130.0110.00914.50
7.0.120.0190.01014.78
7.0.110.0190.00014.25
7.0.100.0100.01714.43
7.0.90.0100.00714.42
7.0.80.0080.00814.49
7.0.70.0030.01314.51
7.0.60.0070.01014.42
7.0.50.0060.01114.34
7.0.40.0150.00314.53
7.0.30.0120.00614.38
7.0.20.0130.00614.70
7.0.10.0090.01514.60
7.0.00.0090.00914.50

preferences:
36.97 ms | 401 KiB | 5 Q