3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A {} class B {} class C {} class D { public function __construct(A $a, B $b, C $c) { // ... } public function doSomething() { return 'Did something with ' . $this->a . ', ' . $this->b . ', ' . $this->c; } } class D_Proxy extends D { private $serviceLocator; private $original; public function __construct(ServiceLocator $serviceLocator) { $this->serviceLocator = $serviceLocator; } private function initialize() { $this->initialized = true; $this->original = $this->serviceLocator->get('D'); } public function doSomething() { if ( ! $this->initialized) { $this->initialize(); } return $this->original->doSomething(); } } class HelloWorld { public function __construct(D $d) { // ... } public function sayHello() { return 'Hello World'; } public function doSomethingWithD() { return $this->d->doSomething(); } }

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.01418.43
8.3.50.0140.00521.89
8.3.40.0120.00918.59
8.3.30.0070.00719.14
8.3.20.0040.00420.20
8.3.10.0090.00022.09
8.3.00.0000.00822.50
8.2.180.0060.00916.63
8.2.170.0110.00322.96
8.2.160.0090.00920.68
8.2.150.0040.00424.18
8.2.140.0050.00324.66
8.2.130.0050.00326.16
8.2.120.0000.00819.23
8.2.110.0030.00622.13
8.2.100.0040.00817.66
8.2.90.0080.00018.91
8.2.80.0000.00817.97
8.2.70.0030.00517.38
8.2.60.0040.00417.80
8.2.50.0000.00818.07
8.2.40.0070.00318.22
8.2.30.0030.00517.82
8.2.20.0000.00717.54
8.2.10.0000.00819.26
8.2.00.0060.00317.55
8.1.280.0040.01125.92
8.1.270.0040.00423.79
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0000.00923.96
8.1.230.0000.01119.09
8.1.220.0020.00517.74
8.1.210.0040.00418.77
8.1.200.0030.00617.23
8.1.190.0080.00017.28
8.1.180.0050.00318.10
8.1.170.0030.00618.57
8.1.160.0040.00421.92
8.1.150.0070.00018.52
8.1.140.0040.00717.24
8.1.130.0070.00017.64
8.1.120.0040.00417.21
8.1.110.0040.00417.35
8.1.100.0040.00317.21
8.1.90.0000.00717.18
8.1.80.0020.00517.32
8.1.70.0040.00417.32
8.1.60.0030.00617.35
8.1.50.0040.00417.39
8.1.40.0000.00817.36
8.1.30.0070.00417.52
8.1.20.0040.00417.36
8.1.10.0040.00417.40
8.1.00.0030.00517.32
8.0.300.0040.00418.77
8.0.290.0000.00817.05
8.0.280.0070.00018.25
8.0.270.0030.00317.13
8.0.260.0000.00716.69
8.0.250.0030.00316.72
8.0.240.0040.00416.82
8.0.230.0070.00016.86
8.0.220.0000.00716.66
8.0.210.0090.00016.82
8.0.200.0030.00316.81
8.0.190.0000.00716.73
8.0.180.0070.00016.77
8.0.170.0000.00716.68
8.0.160.0000.00716.69
8.0.150.0040.00416.63
8.0.140.0000.00716.63
8.0.130.0030.00313.24
8.0.120.0050.00316.64
8.0.110.0040.00416.76
8.0.100.0040.00416.73
8.0.90.0040.00416.71
8.0.80.0070.00716.71
8.0.70.0000.00816.82
8.0.60.0000.00716.72
8.0.50.0000.00716.59
8.0.30.0080.01616.76
8.0.20.0120.01017.40
8.0.10.0040.00416.87
8.0.00.0090.00816.63
7.4.330.0060.00015.00
7.4.320.0060.00016.55
7.4.300.0030.00316.38
7.4.290.0000.00616.40
7.4.280.0030.00516.27
7.4.270.0030.00316.39
7.4.260.0030.00316.30
7.4.250.0000.00716.45
7.4.240.0020.00616.49
7.4.230.0020.00516.22
7.4.220.0120.01216.38
7.4.210.0100.00416.50
7.4.200.0050.00216.57
7.4.190.0000.00716.56
7.4.160.0090.01516.38
7.4.150.0180.00017.40
7.4.140.0080.01117.86
7.4.130.0120.00716.29
7.4.120.0150.00716.30
7.4.110.0100.00716.38
7.4.100.0090.00916.44
7.4.90.0040.01316.58
7.4.80.0070.01119.39
7.4.70.0100.00716.44
7.4.60.0140.00316.29
7.4.50.0080.00016.31
7.4.40.0110.00722.77
7.4.30.0150.00916.32
7.4.00.0000.01614.95
7.3.330.0050.00013.02
7.3.320.0030.00313.19
7.3.310.0000.00716.20
7.3.300.0000.00716.20
7.3.290.0100.00516.18
7.3.280.0100.00616.21
7.3.270.0100.00717.40
7.3.260.0120.01216.49
7.3.250.0100.00916.21
7.3.240.0120.00916.23
7.3.230.0060.01016.39
7.3.210.0080.01416.37
7.3.200.0070.01419.39
7.3.190.0110.01116.28
7.3.180.0080.00816.24
7.3.170.0060.01016.48
7.3.160.0090.01216.21
7.3.120.0060.00614.81
7.3.10.0100.00316.25
7.3.00.0070.00716.06
7.2.330.0130.00316.51
7.2.320.0130.00316.23
7.2.310.0160.00616.51
7.2.300.0190.00316.21
7.2.290.0120.00916.12
7.2.130.0040.01116.59
7.2.120.0030.01016.81
7.2.110.0070.00716.30
7.2.100.0030.01116.23
7.2.90.0030.00916.72
7.2.80.0090.00016.68
7.2.70.0070.00416.61
7.2.60.0030.01016.86
7.2.50.0030.01316.50
7.2.40.0040.00816.79
7.2.30.0030.01016.77
7.2.20.0070.00716.55
7.2.10.0070.00716.56
7.2.00.0040.01116.95
7.1.250.0060.00615.55
7.1.100.0060.00917.90
7.1.70.0120.00316.87
7.1.60.0130.00616.95
7.1.50.0090.00916.75
7.1.00.0030.07722.36
7.0.200.0070.01016.75
7.0.140.0030.07321.98
7.0.60.0070.06019.76
7.0.50.0100.03717.91
7.0.40.0070.08320.28
7.0.30.0230.05320.13
7.0.20.0230.03720.26
7.0.10.0030.07720.06
7.0.00.0070.08720.05
5.6.280.0030.07020.88
5.6.210.0170.07020.62
5.6.200.0100.07718.16
5.6.190.0070.06320.47
5.6.180.0100.06020.64
5.6.170.0230.08020.55
5.6.160.0030.04320.54
5.6.150.0100.03318.18
5.6.140.0070.05718.15
5.6.130.0130.07718.20
5.6.120.0030.05321.13
5.6.110.0070.08321.00
5.6.100.0070.07021.02
5.6.90.0070.05721.00
5.6.80.0100.04020.48
5.5.350.0130.07320.42
5.5.340.0130.06717.95
5.5.330.0070.07720.43
5.5.320.0370.07020.26
5.5.310.0270.06020.34
5.5.300.0070.04717.93
5.5.290.0070.03718.08
5.5.280.0100.08020.98
5.5.270.0000.06020.78
5.5.260.0130.04020.98
5.5.250.0030.06720.63
5.5.240.0030.08320.08
5.4.450.0200.04019.46
5.4.440.0530.04319.57
5.4.430.0430.04719.19
5.4.420.0370.03719.45
5.4.410.0170.05318.86
5.4.400.0170.04718.55
5.4.390.0100.05318.75
5.4.380.0170.05018.61
5.4.370.0270.05318.80
5.4.360.0400.04318.56
5.4.350.0330.05718.77
5.4.340.0300.05318.64
5.4.320.0110.03512.52
5.4.310.0050.04312.51
5.4.300.0060.03612.52
5.4.290.0060.03712.52
5.4.280.0060.04012.41
5.4.270.0060.03512.41
5.4.260.0060.03712.41
5.4.250.0070.03612.41
5.4.240.0100.04212.41
5.4.230.0090.03712.41
5.4.220.0060.03612.41
5.4.210.0080.03312.41
5.4.200.0100.04512.40
5.4.190.0130.04712.39
5.4.180.0210.03712.39
5.4.170.0120.04612.41
5.4.160.0170.04212.40
5.4.150.0130.04812.40
5.4.140.0150.04312.08
5.4.130.0160.04512.07
5.4.120.0140.04512.03
5.4.110.0160.04412.03
5.4.100.0280.06512.02
5.4.90.0170.04512.03
5.4.80.0150.04912.02
5.4.70.0170.04412.02
5.4.60.0170.04312.02
5.4.50.0150.04312.02
5.4.40.0170.04412.00
5.4.30.0210.04212.00
5.4.20.0150.04512.00
5.4.10.0180.04112.00
5.4.00.0130.04211.49
5.3.290.0060.03912.80
5.3.280.0080.04512.71
5.3.270.0190.04312.73
5.3.260.0180.04312.72
5.3.250.0130.04712.72
5.3.240.0130.04812.72
5.3.230.0180.04412.71
5.3.220.0130.04712.68
5.3.210.0130.04712.68
5.3.200.0200.04612.68
5.3.190.0160.05012.68
5.3.180.0130.05312.67
5.3.170.0180.04412.67
5.3.160.0160.04612.67
5.3.150.0130.05012.67
5.3.140.0150.04912.66
5.3.130.0120.05012.66
5.3.120.0140.04812.66
5.3.110.0150.04812.66
5.3.100.0190.04412.14
5.3.90.0160.04712.13
5.3.80.0170.04712.11
5.3.70.0130.05012.11
5.3.60.0160.04812.09
5.3.50.0200.04212.04
5.3.40.0170.04812.04
5.3.30.0180.05012.02
5.3.20.0190.04711.79
5.3.10.0140.04711.75
5.3.00.0110.04911.73
5.2.170.0130.0369.23
5.2.160.0150.0359.23
5.2.150.0210.0319.23
5.2.140.0180.0339.23
5.2.130.0170.0459.20
5.2.120.0190.0359.19
5.2.110.0130.0389.20
5.2.100.0160.0359.20
5.2.90.0200.0359.21
5.2.80.0140.0379.19
5.2.70.0170.0449.20
5.2.60.0150.0439.15
5.2.50.0210.0399.11
5.2.40.0220.0349.09
5.2.30.0140.0369.06
5.2.20.0160.0359.06
5.2.10.0170.0368.96
5.2.00.0190.0348.82
5.1.60.0100.0328.10
5.1.50.0140.0298.10
5.1.40.0160.0258.09
5.1.30.0110.0348.43
5.1.20.0150.0298.46
5.1.10.0140.0318.18
5.1.00.0100.0338.18
5.0.50.0100.0256.66
5.0.40.0120.0216.52
5.0.30.0080.0376.34
5.0.20.0110.0246.30
5.0.10.0110.0246.28
5.0.00.0130.0526.27
4.4.90.0090.0184.78
4.4.80.0090.0174.76
4.4.70.0070.0204.75
4.4.60.0130.0164.75
4.4.50.0100.0194.77
4.4.40.0070.0294.71
4.4.30.0060.0224.76
4.4.20.0060.0204.85
4.4.10.0080.0194.85
4.4.00.0110.0274.76
4.3.110.0070.0194.67
4.3.100.0060.0194.67
4.3.90.0100.0154.63
4.3.80.0130.0224.58
4.3.70.0080.0174.63
4.3.60.0030.0224.63
4.3.50.0040.0214.63
4.3.40.0070.0274.54
4.3.30.0060.0183.30
4.3.20.0060.0173.29
4.3.10.0060.0173.25
4.3.00.0070.01313.29

preferences:
42.15 ms | 401 KiB | 5 Q