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(); } } $hello = HelloWorld(); return $hello;

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.0130.00316.60
8.3.50.0120.01122.03
8.3.40.0110.00418.66
8.3.30.0070.00719.01
8.3.20.0030.00520.34
8.3.10.0080.00023.53
8.3.00.0080.00020.97
8.2.180.0110.00416.88
8.2.170.0110.00722.96
8.2.160.0070.01120.35
8.2.150.0150.00024.18
8.2.140.0070.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00022.08
8.2.110.0070.00419.34
8.2.100.0110.00017.91
8.2.90.0000.00817.91
8.2.80.0050.00317.97
8.2.70.0040.00417.80
8.2.60.0040.00417.91
8.2.50.0080.00018.10
8.2.40.0030.00622.23
8.2.30.0000.00718.27
8.2.20.0030.00517.57
8.2.10.0000.00717.88
8.2.00.0040.00417.57
8.1.280.0060.01225.92
8.1.270.0080.00023.88
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0120.00020.55
8.1.230.0090.00320.85
8.1.220.0050.00317.74
8.1.210.0030.00518.77
8.1.200.0080.00017.23
8.1.190.0000.00817.13
8.1.180.0040.00418.10
8.1.170.0040.00418.59
8.1.160.0050.00321.86
8.1.150.0000.00718.43
8.1.140.0070.00017.24
8.1.130.0030.00317.78
8.1.120.0040.00417.39
8.1.110.0040.00417.24
8.1.100.0050.00317.26
8.1.90.0000.00717.34
8.1.80.0000.00717.36
8.1.70.0000.00717.29
8.1.60.0070.00017.35
8.1.50.0040.00417.38
8.1.40.0040.00417.43
8.1.30.0050.00317.59
8.1.20.0050.00317.56
8.1.10.0000.00817.56
8.1.00.0040.00417.45
8.0.300.0050.00319.86
8.0.290.0090.00016.88
8.0.280.0070.00018.44
8.0.270.0000.00717.20
8.0.260.0030.00517.25
8.0.250.0030.00316.91
8.0.240.0050.00316.95
8.0.230.0000.00716.96
8.0.220.0000.00716.91
8.0.210.0030.00316.96
8.0.200.0030.00317.00
8.0.190.0040.00417.00
8.0.180.0030.00616.81
8.0.170.0050.00316.95
8.0.160.0000.00816.96
8.0.150.0030.00516.91
8.0.140.0000.00716.76
8.0.130.0030.00313.29
8.0.120.0090.00016.85
8.0.110.0000.00816.93
8.0.100.0030.00616.77
8.0.90.0040.00416.92
8.0.80.0000.02216.82
8.0.70.0080.00016.93
8.0.60.0000.00716.91
8.0.50.0040.00416.72
8.0.30.0110.00817.09
8.0.20.0080.01117.40
8.0.10.0040.00417.00
8.0.00.0100.01016.69
7.4.330.0020.00215.00
7.4.320.0060.00016.39
7.4.300.0000.00616.55
7.4.290.0000.00716.51
7.4.280.0030.00516.46
7.4.270.0030.00316.43
7.4.260.0030.00316.39
7.4.250.0000.00816.46
7.4.240.0000.00716.50
7.4.230.0000.00816.65
7.4.220.0120.00616.52
7.4.210.0110.00416.48
7.4.200.0030.00316.29
7.4.190.0000.00816.63
7.4.160.0080.00816.46
7.4.150.0060.01017.40
7.4.140.0100.00817.86
7.4.130.0120.00516.50
7.4.120.0100.00716.35
7.4.110.0080.01616.42
7.4.100.0130.00316.59
7.4.90.0200.00016.33
7.4.80.0150.00619.39
7.4.70.0130.00316.67
7.4.60.0090.00916.61
7.4.50.0040.00416.48
7.4.40.0100.01616.65
7.4.30.0110.00516.35
7.4.00.0090.00615.09
7.3.330.0000.00613.24
7.3.320.0030.00313.18
7.3.310.0050.00316.27
7.3.300.0030.00316.18
7.3.290.0040.01116.29
7.3.280.0090.00816.33
7.3.270.0090.00917.40
7.3.260.0120.01216.28
7.3.250.0070.01016.54
7.3.240.0090.00616.51
7.3.230.0120.00616.56
7.3.210.0080.00816.44
7.3.200.0030.01319.39
7.3.190.0120.00916.58
7.3.180.0100.00616.41
7.3.170.0120.00316.34
7.3.160.0080.00816.25
7.3.120.0030.01114.61
7.3.10.0060.00716.57
7.3.00.0090.00416.54
7.2.330.0120.00616.48
7.2.320.0030.01516.62
7.2.310.0000.01816.69
7.2.300.0060.01016.41
7.2.290.0080.00816.55
7.2.130.0050.01116.85
7.2.120.0080.00716.67
7.2.110.0030.00916.79
7.2.100.0020.01016.74
7.2.90.0080.00516.92
7.2.80.0070.00516.61
7.2.70.0080.00616.76
7.2.60.0040.00616.81
7.2.50.0070.00516.82
7.2.40.0080.00616.86
7.2.30.0030.01116.72
7.2.20.0060.00716.87
7.2.10.0070.00416.84
7.2.00.0100.00317.65
7.1.250.0060.00515.69
7.1.240.0040.01115.80
7.1.230.0000.01115.49
7.1.220.0080.00015.63
7.1.210.0030.00915.46
7.1.200.0070.00715.33
7.1.190.0000.00815.56
7.1.180.0030.00615.68
7.1.170.0090.00315.63
7.1.160.0030.01015.48
7.1.150.0070.00715.77
7.1.140.0000.01215.51
7.1.130.0060.00915.67
7.1.120.0030.01015.63
7.1.110.0050.00315.47
7.1.100.0050.00515.77
7.1.90.0040.00415.45
7.1.80.0030.00915.61
7.1.70.0030.00616.27
7.1.60.0060.00716.41
7.1.50.0070.00815.94
7.1.40.0070.00715.73
7.1.30.0040.00415.64
7.1.20.0060.00915.64
7.1.10.0000.00715.62
7.1.00.0040.04118.81
7.0.330.0030.00615.18
7.0.320.0090.00915.30
7.0.310.0020.00515.32
7.0.300.0040.01115.46
7.0.290.0030.00715.03
7.0.280.0100.00315.02
7.0.270.0030.00915.19
7.0.260.0000.01215.42
7.0.250.0040.00715.22
7.0.240.0000.01215.32
7.0.230.0000.01415.36
7.0.220.0030.01015.11
7.0.210.0030.00715.00
7.0.200.0030.01115.88
7.0.190.0070.00714.96
7.0.180.0000.01415.39
7.0.170.0040.00815.36
7.0.160.0000.01215.39
7.0.150.0080.00015.39
7.0.140.0000.04218.66
7.0.130.0110.00014.90
7.0.120.0060.00315.13
7.0.110.0040.00415.13
7.0.100.0050.00315.22
7.0.90.0040.00415.30
7.0.80.0040.00815.39
7.0.70.0070.04318.39
7.0.60.0020.02818.43
7.0.50.0030.04518.77
7.0.40.0090.03516.68
7.0.30.0070.04516.58
7.0.20.0100.03516.84
7.0.10.0020.02816.62
7.0.00.0050.03816.61
5.6.380.0080.00814.33
5.6.370.0030.01013.99
5.6.360.0000.01014.17
5.6.350.0040.01114.33
5.6.340.0030.00614.32
5.6.330.0000.01514.01
5.6.320.0060.00614.22
5.6.310.0100.00314.10
5.6.300.0040.00413.85
5.6.290.0070.00714.38
5.6.280.0030.05017.57
5.6.270.0080.00414.26
5.6.260.0090.00314.39
5.6.250.0030.01014.24
5.6.240.0060.00614.07
5.6.230.0060.00613.91
5.6.220.0060.03917.34
5.6.210.0050.02217.32
5.6.200.0120.04017.70
5.6.190.0080.04017.57
5.6.180.0050.04317.73
5.6.170.0100.03517.60
5.6.160.0040.02717.51
5.6.150.0030.02617.56
5.6.140.0080.01817.47
5.6.130.0050.02417.58
5.6.120.0050.04117.46
5.6.110.0050.02617.56
5.6.100.0040.02717.44
5.6.90.0050.02517.61
5.6.80.0050.04017.26
5.6.70.0080.03817.38
5.6.60.0060.02517.30
5.6.50.0030.04317.17
5.6.40.0060.03117.21
5.6.30.0020.04717.27
5.6.20.0000.04817.25
5.6.10.0060.04217.24
5.6.00.0060.02317.10
5.5.380.0050.00511.21
5.5.370.0000.00710.96
5.5.360.0050.04515.67
5.5.350.0050.02815.59
5.5.340.0020.05115.73
5.5.330.0050.03215.92
5.5.320.0030.04515.93
5.5.310.0040.04415.84
5.5.300.0040.02415.84
5.5.290.0030.02315.85
5.5.280.0020.05015.74
5.5.270.0030.03115.89
5.5.260.0050.02315.89
5.5.250.0020.03315.78
5.5.240.0030.02815.39
5.5.230.0060.04215.45
5.5.220.0040.02315.53
5.5.210.0020.02815.43
5.5.200.0070.03815.44
5.5.190.0060.02815.49
5.5.180.0030.02515.60
5.5.170.0090.00310.99
5.5.160.0030.02815.63
5.5.150.0070.03515.39
5.5.140.0080.03815.42
5.5.130.0060.03915.44
5.5.120.0030.02815.60
5.5.110.0100.03215.57
5.5.100.0000.02515.60
5.5.90.0050.03615.43
5.5.80.0030.04115.45
5.5.70.0030.04415.55
5.5.60.0030.02715.30
5.5.50.0020.03715.37
5.5.40.0030.04115.42
5.5.30.0060.03815.46
5.5.20.0030.03015.32
5.5.10.0020.04415.45
5.5.00.0030.04315.35
5.4.450.0030.02215.22
5.4.440.0020.04415.31
5.4.430.0110.02215.21
5.4.420.0030.03815.15
5.4.410.0020.02915.03
5.4.400.0030.04014.78
5.4.390.0080.03514.98
5.4.380.0050.03014.86
5.4.370.0020.03114.81
5.4.360.0030.04414.87
5.4.350.0020.02915.02
5.4.340.0000.03415.10
5.4.330.0060.00310.71
5.4.320.0020.03814.94
5.4.310.0060.04014.88
5.4.300.0000.04514.72
5.4.290.0050.02814.74
5.4.280.0020.03815.06
5.4.270.0070.03715.06
5.4.260.0050.02514.80
5.4.250.0020.04414.79
5.4.240.0070.03814.94
5.4.230.0050.03314.96
5.4.220.0050.04214.79
5.4.210.0020.04015.05
5.4.200.0030.03714.85
5.4.190.0110.03714.82
5.4.180.0080.03815.06
5.4.170.0020.03115.00
5.4.160.0030.04414.80
5.4.150.0020.04614.80
5.4.140.0050.04013.71
5.4.130.0020.04013.71
5.4.120.0000.04013.51
5.4.110.0020.04313.70
5.4.100.0000.04213.74
5.4.90.0020.03913.71
5.4.80.0020.03713.73
5.4.70.0050.03213.64
5.4.60.0030.03713.56
5.4.50.0090.02813.69
5.4.40.0020.03713.60
5.4.30.0000.04013.60
5.4.20.0040.03513.69
5.4.10.0000.04313.63
5.4.00.0050.04013.28
5.3.290.0020.03812.57
5.3.280.0000.03912.53
5.3.270.0040.03412.50
5.3.260.0050.04212.47
5.3.250.0020.04212.56
5.3.240.0040.02912.42
5.3.230.0070.03012.54
5.3.220.0020.04212.48
5.3.210.0030.03012.57
5.3.200.0030.04312.51
5.3.190.0030.02712.52
5.3.180.0070.03812.51
5.3.170.0050.02512.51
5.3.160.0030.04212.53
5.3.150.0040.03812.51
5.3.140.0050.04412.42
5.3.130.0030.04512.39
5.3.120.0080.03212.48
5.3.110.0030.02612.38
5.3.100.0060.03512.20
5.3.90.0060.04012.21
5.3.80.0020.04312.33
5.3.70.0000.04412.16
5.3.60.0020.02812.25
5.3.50.0000.04412.10
5.3.40.0040.03412.25
5.3.30.0040.02112.09
5.3.20.0020.04211.93
5.3.10.0020.03411.97
5.3.00.0010.03911.96
5.2.170.0010.02611.37
5.2.160.0030.01711.37
5.2.150.0030.01711.37
5.2.140.0020.01811.37
5.2.130.0020.02311.37
5.2.120.0030.01611.37
5.2.110.0020.03411.37
5.2.100.0040.02711.37
5.2.90.0000.02411.37
5.2.80.0030.01811.37
5.2.70.0000.02311.37
5.2.60.0040.02811.37
5.2.50.0020.03011.37
5.2.40.0000.03511.37
5.2.30.0030.02811.37
5.2.20.0030.03211.37
5.2.10.0020.03311.37
5.2.00.0050.03311.37
5.1.60.0030.02011.37
5.1.50.0020.03011.37
5.1.40.0040.01311.37
5.1.30.0000.02111.37
5.1.20.0010.01511.37
5.1.10.0040.02811.37
5.1.00.0020.03111.37
5.0.50.0050.02311.37
5.0.40.0000.02511.37
5.0.30.0010.03611.37
5.0.20.0030.02211.37
5.0.10.0030.01811.37
5.0.00.0030.02011.37
4.4.90.0020.01311.37
4.4.80.0030.01811.37
4.4.70.0000.01811.37
4.4.60.0000.02011.37
4.4.50.0030.01811.37
4.4.40.0020.02911.37
4.4.30.0020.01811.37
4.4.20.0030.01911.37
4.4.10.0030.01711.37
4.4.00.0020.02811.37
4.3.110.0000.02111.37
4.3.100.0020.01811.37
4.3.90.0000.02211.37
4.3.80.0040.01411.37
4.3.70.0010.01811.37
4.3.60.0000.01711.37
4.3.50.0020.00811.37
4.3.40.0030.02611.37
4.3.30.0000.02211.37
4.3.20.0000.02111.37
4.3.10.0020.01511.37
4.3.00.0020.01111.37

preferences:
41.34 ms | 400 KiB | 5 Q