3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface A { public function foo(); } class B implements A { public function foo() { echo "foo"; } public function bar() { echo "bar"; } } class C { public function __construct(protected A $prop) { $this->prop->foo(); } } class D extends C { public function __construct(B $prop) {// Remove "protected" so that this is just an argument, not a property // Call the parent so that the field has a value parent::__construct($prop); $this->prop->bar(); } } $b = new B(); $d = new D($b);

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.4.130.0100.00919.65
8.4.120.0090.00920.82
8.4.110.0100.01122.43
8.4.100.0070.01017.70
8.4.90.0110.00918.76
8.4.80.0110.00919.54
8.4.70.0060.00717.97
8.4.60.0110.00918.54
8.4.50.0110.00819.63
8.4.40.0100.00717.55
8.4.30.0050.00323.75
8.4.20.0070.01319.32
8.4.10.0080.00019.27
8.3.260.0040.00416.45
8.3.250.0120.00618.88
8.3.240.0110.01216.79
8.3.230.0130.00716.83
8.3.220.0050.00317.23
8.3.210.0080.00116.63
8.3.200.0060.00516.66
8.3.190.0120.00617.09
8.3.180.0110.00716.71
8.3.170.0090.00917.18
8.3.160.0100.01018.86
8.3.150.0040.00417.20
8.3.140.0080.00018.41
8.3.130.0000.00816.80
8.3.120.0300.01516.37
8.3.110.0340.00416.63
8.3.100.0310.01416.49
8.3.90.0220.00816.51
8.3.80.0220.00316.48
8.3.70.0250.00016.44
8.3.60.0220.00316.55
8.3.50.0220.00016.55
8.3.40.0080.01017.46
8.3.30.0110.00717.52
8.3.20.0180.00317.48
8.3.10.0150.00417.38
8.3.00.0290.01117.51
8.2.290.0100.00920.32
8.2.280.0040.00418.52
8.2.270.0030.01616.54
8.2.260.0110.00817.27
8.2.250.0120.00316.65
8.2.240.0270.01416.18
8.2.230.0350.00716.36
8.2.220.0220.00716.40
8.2.210.0320.00416.14
8.2.200.0300.00716.52
8.2.190.0240.00316.40
8.2.180.0170.00316.65
8.2.170.0140.00717.63
8.2.160.0210.00017.38
8.2.150.0150.00517.45
8.2.140.0170.00217.41
8.2.130.0190.00017.64
8.2.120.0160.00517.21
8.2.110.0200.00017.52
8.2.100.0170.00317.49
8.2.90.0150.00617.43
8.2.80.0240.01217.34
8.2.70.0380.00417.63
8.2.60.0350.01317.38
8.2.50.0370.00417.30
8.2.40.0280.01117.23
8.2.30.0250.01117.31
8.2.20.0240.00617.39
8.2.10.0350.00017.12
8.2.00.0270.01217.49
8.1.330.0120.00622.05
8.1.320.0110.00916.24
8.1.310.0070.01118.39
8.1.300.0340.00716.08
8.1.290.0310.00915.71
8.1.280.0280.01216.11
8.1.270.0360.00716.93
8.1.260.0370.00716.98
8.1.250.0420.00816.95
8.1.240.0300.00916.90
8.1.230.0280.00317.24
8.1.220.0310.00717.26
8.1.210.0220.01517.16
8.1.200.0270.01017.16
8.1.190.0220.00617.14
8.1.180.0290.00717.15
8.1.170.0250.01117.08
8.1.160.0320.00416.91
8.1.150.0300.00717.21
8.1.140.0370.00017.16
8.1.130.0330.00816.97
8.1.120.0210.01117.25
8.1.110.0260.01017.09
8.1.100.0310.00617.12
8.1.90.0270.01216.92
8.1.80.0280.00317.18
8.1.70.0290.00417.14
8.1.60.0300.00717.22
8.1.50.0390.00817.34
8.1.40.0290.01017.16
8.1.30.0340.00617.34
8.1.20.0270.01317.21
8.1.10.0360.00417.40
8.1.00.0290.00717.04

preferences:
27.48 ms | 403 KiB | 5 Q