3v4l.org

run code in 300+ PHP versions simultaneously
<?php final class A extends B { private $B; public function __construct(array $config) { $this->B = new B($config); } public function check(int $id) { if ( $this->checkSomething($id) ) { // ... } } public function setLang(string $lang) { $this->repository->setLang($lang); } public function getB() { return $B; } } class B { protected $repository; protected function __construct(array $config) { $this->repository = new Repository ($config); } protected function checkSomething(int $id) { if ( $this->repository->checkById($id) ) { return TRUE; } } public function get() { return 'whatever'; } } $config = ['some', 'config']; $A = new A($config); echo $A->getB()->get();

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.0040.01118.55
8.3.50.0070.01017.95
8.3.40.0040.01118.96
8.3.30.0070.00718.80
8.3.20.0050.00321.90
8.3.10.0070.00318.87
8.3.00.0040.00417.63
8.2.180.0110.00416.38
8.2.170.0110.01122.96
8.2.160.0140.00021.98
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0090.00017.97
8.2.120.0080.00026.35
8.2.110.0050.00521.12
8.2.100.0080.00417.91
8.2.90.0050.00218.22
8.2.80.0050.00317.97
8.2.70.0040.00417.79
8.2.60.0050.00318.22
8.2.50.0000.00818.10
8.2.40.0040.00419.35
8.2.30.0000.00719.27
8.2.20.0000.00818.13
8.2.10.0000.00719.33
8.2.00.0060.00318.05
8.1.280.0140.00025.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0140.00720.76
8.1.230.0110.00020.88
8.1.220.0000.00817.77
8.1.210.0000.00818.96
8.1.200.0000.00817.35
8.1.190.0060.00317.48
8.1.180.0090.00018.10
8.1.170.0040.00418.65
8.1.160.0030.00518.81
8.1.150.0030.00618.95
8.1.140.0030.00518.85
8.1.130.0030.00320.07
8.1.120.0000.00817.52
8.1.110.0000.00717.43
8.1.100.0030.00717.36
8.1.90.0050.00317.51
8.1.80.0040.00417.51
8.1.70.0000.00717.43
8.1.60.0000.00917.52
8.1.50.0080.00017.51
8.1.40.0030.00617.43
8.1.30.0030.00617.68
8.1.20.0030.00617.52
8.1.10.0040.00417.57
8.1.00.0000.00717.51
8.0.300.0000.00719.89
8.0.290.0030.00616.88
8.0.280.0040.00418.46
8.0.270.0000.00817.15
8.0.260.0040.00418.38
8.0.250.0060.00316.93
8.0.240.0040.00417.04
8.0.230.0070.00017.09
8.0.220.0030.00316.97
8.0.210.0070.00016.98
8.0.200.0070.00017.04
8.0.190.0110.00016.99
8.0.180.0050.00317.02
8.0.170.0030.00616.94
8.0.160.0050.00217.09
8.0.150.0030.00616.93
8.0.140.0000.00716.95
8.0.130.0030.00313.41
8.0.120.0050.00316.95
8.0.110.0000.00816.91
8.0.100.0030.00317.04
8.0.90.0000.00716.93
8.0.80.0090.00916.93
8.0.70.0000.00716.80
8.0.60.0000.00716.76
8.0.50.0030.00316.96
8.0.30.0110.00917.04
8.0.20.0130.00616.87
8.0.10.0040.00416.95
8.0.00.0120.00616.79
7.4.330.0050.00015.55
7.4.320.0050.00216.65
7.4.300.0000.00616.53
7.4.290.0020.00516.55
7.4.280.0040.00416.53
7.4.270.0030.00316.54
7.4.260.0040.00416.60
7.4.250.0030.00316.45
7.4.240.0020.00516.60
7.4.230.0070.00016.41
7.4.220.0070.00016.61
7.4.210.0120.00816.66
7.4.200.0030.00316.52
7.4.160.0070.00916.64
7.4.140.0130.00817.86
7.4.130.0100.01316.39
7.4.120.0120.00816.68
7.4.110.0090.00916.64
7.4.100.0040.01816.55
7.4.90.0030.01716.63
7.4.80.0170.00019.39
7.4.70.0130.00516.46
7.4.60.0110.00616.57
7.4.50.0090.00616.47
7.4.40.0070.01116.53
7.4.00.0100.00615.16
7.3.330.0060.00013.34
7.3.320.0030.00313.40
7.3.310.0000.00716.41
7.3.300.0070.00016.21
7.3.290.0030.00316.34
7.3.280.0080.00916.40
7.3.260.0090.01016.56
7.3.240.0100.00716.37
7.3.230.0110.00616.54
7.3.210.0030.01316.48
7.3.200.0110.00816.43
7.3.190.0170.00616.37
7.3.180.0070.01016.32
7.3.170.0160.00316.57
7.3.160.0030.01316.36
7.3.10.0440.00314.86
7.3.00.0330.00714.93
7.2.330.0140.00316.61
7.2.320.0060.01216.60
7.2.310.0120.00416.60
7.2.300.0120.00316.57
7.2.290.0040.01316.39
7.2.130.0450.01014.85
7.2.120.0410.00714.54
7.2.110.0340.00914.69
7.2.100.0620.00714.98
7.2.90.0420.01014.99
7.2.80.0300.00715.07
7.2.70.0390.01014.77
7.2.60.0320.00315.07
7.2.50.0330.00414.95
7.2.40.0320.00414.88
7.2.30.0510.00314.85
7.2.20.0340.00315.00
7.2.10.0320.00614.86
7.2.00.0350.00314.73
7.1.250.1200.01013.54

preferences:
58.46 ms | 401 KiB | 5 Q