3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Repository { public function checkById() { return true; } } class A extends B { public function __construct(array $config) { // other stuff parent::__construct($config); // other stuff } public function check(int $id) { if ( $this->checkSomething($id) ) { return 'bla'; } } public function setLang(string $lang) { $this->repository->setLang($lang); } } 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); var_dump($a->get()); var_dump($a->check(1));

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.0000.01518.30
8.3.50.0110.01418.41
8.3.40.0100.00718.50
8.3.30.0120.00318.71
8.3.20.0030.00621.90
8.3.10.0070.00420.36
8.3.00.0050.00317.63
8.2.180.0060.00816.63
8.2.170.0120.00322.96
8.2.160.0100.00322.08
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00421.00
8.2.110.0040.00419.06
8.2.100.0070.00417.78
8.2.90.0050.00318.30
8.2.80.0080.00017.97
8.2.70.0050.00317.93
8.2.60.0070.00318.16
8.2.50.0080.00018.10
8.2.40.0030.00619.23
8.2.30.0030.00519.27
8.2.20.0050.00318.07
8.2.10.0000.00719.27
8.2.00.0000.00718.05
8.1.280.0130.00725.92
8.1.270.0000.00720.42
8.1.260.0040.00426.35
8.1.250.0000.00728.09
8.1.240.0030.00917.39
8.1.230.0000.01021.04
8.1.220.0060.00317.76
8.1.210.0040.00418.85
8.1.200.0040.00417.25
8.1.190.0000.00817.21
8.1.180.0040.00418.10
8.1.170.0000.00818.54
8.1.160.0080.00018.79
8.1.150.0040.00418.70
8.1.140.0040.00418.82
8.1.130.0000.00720.07
8.1.120.0000.00717.49
8.1.110.0000.00717.38
8.1.100.0060.00317.45
8.1.90.0000.00817.38
8.1.80.0000.00817.34
8.1.70.0040.00417.49
8.1.60.0030.00617.46
8.1.50.0060.00317.42
8.1.40.0000.00917.49
8.1.30.0080.00017.55
8.1.20.0000.00817.66
8.1.10.0030.00517.47
8.1.00.0040.00417.46
8.0.300.0040.00419.59
8.0.290.0060.00316.63
8.0.280.0040.00418.34
8.0.270.0040.00417.15
8.0.260.0030.00318.58
8.0.250.0050.00517.01
8.0.240.0030.00316.95
8.0.230.0070.00016.86
8.0.220.0000.00816.91
8.0.210.0070.00016.81
8.0.200.0030.00316.87
8.0.190.0090.00016.99
8.0.180.0000.00916.94
8.0.170.0000.00916.91
8.0.160.0050.00316.94
8.0.150.0040.00416.97
8.0.140.0040.00316.79
8.0.130.0030.00313.30
8.0.120.0000.00716.80
8.0.110.0070.00016.93
8.0.100.0070.00016.79
8.0.90.0000.00816.89
8.0.80.0090.00916.86
8.0.70.0040.00416.75
8.0.60.0000.00816.83
8.0.50.0070.00016.91
8.0.30.0150.00517.18
8.0.20.0070.01617.12
8.0.10.0060.00316.93
8.0.00.0080.01016.78
7.4.330.0030.00315.55
7.4.320.0020.00516.52
7.4.300.0060.00016.43
7.4.290.0030.00316.47
7.4.280.0060.00316.54
7.4.270.0070.00016.53
7.4.260.0080.00016.49
7.4.250.0040.00416.45
7.4.240.0000.00716.64
7.4.230.0070.00016.63
7.4.220.0030.00516.41
7.4.210.0070.00916.58
7.4.200.0040.00416.65
7.4.160.0070.00816.48
7.4.140.0130.00517.86
7.4.130.0070.01016.46
7.4.120.0150.00616.69
7.4.110.0140.00316.35
7.4.100.0140.00316.53
7.4.90.0110.00616.54
7.4.80.0080.00919.39
7.4.70.0030.01616.53
7.4.60.0100.00716.57
7.4.50.0080.00816.50
7.4.40.0030.01316.44
7.4.00.0070.01015.02
7.3.330.0000.00513.14
7.3.320.0030.00313.15
7.3.310.0030.00516.37
7.3.300.0030.00316.38
7.3.290.0070.00016.36
7.3.280.0080.00816.33
7.3.260.0140.00616.44
7.3.240.0090.01216.52
7.3.230.0140.00316.30
7.3.210.0030.01416.34
7.3.200.0080.00816.50
7.3.190.0130.00416.48
7.3.180.0100.01016.30
7.3.170.0090.01216.36
7.3.160.0130.00616.60
7.3.10.0500.00714.78
7.3.00.0650.00714.60
7.2.330.0180.00616.57
7.2.320.0030.01316.34
7.2.310.0080.00916.61
7.2.300.0060.01016.76
7.2.290.0100.00616.52
7.2.130.0540.01614.56
7.2.120.0610.00314.82
7.2.110.0530.01015.11
7.2.100.0600.00714.95
7.2.90.0580.01015.05
7.2.80.0470.00315.00
7.2.70.0800.00615.11
7.2.60.0710.01315.02
7.2.50.0560.01315.16
7.2.40.0720.00715.16
7.2.30.0520.00315.24
7.2.20.0540.00414.92
7.2.10.0600.01315.06
7.2.00.0520.00714.92
7.1.250.0820.00313.75

preferences:
59.41 ms | 400 KiB | 5 Q