3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Table { public function getTableName(); } class TableA implements Table { public function getTableName() { return 'TableA'; } } class TableB implements Table { public function getTableName() { return 'TableB'; } } class TableC implements Table { public function getTableName() { return 'TableC'; } } class TableD implements Table { public function getTableName() { return 'TableD'; } } class Service { public $tableA; public $tableB; public $tableC; public $tableD; public function __construct(Table $a, Table $b, Table $c, Table $d) { $this->tableA = $a; $this->tableB = $b; $this->tableC = $c; $this->tableD = $d; } public function table_A_and_B_doSomething() { echo $this->tableA->getTableName(), ' ', $this->tableB->getTableName(); } public function table_C_and_D_doSomething() { echo $this->tableC->getTableName(), ' ', $this->tableD->getTableName(); } } $service = new Service(new tableA(), new tableB(), new tableC(), new tableD()); $service->table_C_and_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.0100.00718.68
8.3.50.0070.01121.97
8.3.40.0070.00718.71
8.3.30.0070.00719.23
8.3.20.0100.00320.34
8.3.10.0000.00823.66
8.3.00.0050.00319.25
8.2.180.0000.01516.75
8.2.170.0190.00022.96
8.2.160.0130.00620.27
8.2.150.0060.00324.18
8.2.140.0000.00824.66
8.2.130.0000.00726.16
8.2.120.0040.00422.27
8.2.110.0070.00321.00
8.2.100.0130.00017.84
8.2.90.0060.00319.06
8.2.80.0040.00417.97
8.2.70.0050.00317.50
8.2.60.0070.00317.92
8.2.50.0040.00418.07
8.2.40.0040.00418.29
8.2.30.0040.00418.13
8.2.20.0030.00617.80
8.2.10.0000.00717.95
8.2.00.0060.00317.68
8.1.280.0070.01125.92
8.1.270.0040.00923.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00719.21
8.1.230.0060.00618.98
8.1.220.0050.00317.74
8.1.210.0080.00018.77
8.1.200.0070.00417.36
8.1.190.0080.00317.00
8.1.180.0040.00418.10
8.1.170.0090.00018.76
8.1.160.0050.00218.88
8.1.150.0020.00518.93
8.1.140.0040.00417.52
8.1.130.0030.00317.76
8.1.120.0020.00517.46
8.1.110.0030.00617.44
8.1.100.0040.00417.42
8.1.90.0030.00717.48
8.1.80.0040.00417.38
8.1.70.0030.00317.41
8.1.60.0050.00317.55
8.1.50.0040.00417.50
8.1.40.0000.00817.54
8.1.30.0000.00917.62
8.1.20.0040.00417.71
8.1.10.0040.00417.61
8.1.00.0030.00617.47
8.0.300.0020.00518.77
8.0.290.0030.00616.88
8.0.280.0070.00018.49
8.0.270.0030.00317.25
8.0.260.0070.00018.46
8.0.250.0070.00016.91
8.0.240.0000.00816.89
8.0.230.0030.00317.01
8.0.220.0000.00716.86
8.0.210.0030.00517.00
8.0.200.0030.00316.98
8.0.190.0070.00416.91
8.0.180.0030.00516.88
8.0.170.0000.00816.93
8.0.160.0070.00016.95
8.0.150.0040.00416.75
8.0.140.0040.00416.91
8.0.130.0030.00313.44
8.0.120.0080.00016.90
8.0.110.0040.00416.93
8.0.100.0040.00416.83
8.0.90.0040.00416.95
8.0.80.0030.01416.84
8.0.70.0040.00416.83
8.0.60.0040.00416.93
8.0.50.0040.00416.89
8.0.30.0080.01217.34
8.0.20.0090.01117.40
8.0.10.0100.00017.03
8.0.00.0060.01216.65
7.4.330.0020.00215.08
7.4.320.0000.00616.59
7.4.300.0060.00016.55
7.4.290.0030.00316.63
7.4.280.0040.00416.51
7.4.270.0000.00716.63
7.4.260.0040.00416.63
7.4.250.0030.00616.63
7.4.240.0020.00516.57
7.4.230.0070.00016.63
7.4.220.0080.00916.54
7.4.210.0140.00716.69
7.4.200.0050.00316.60
7.4.160.0120.00316.36
7.4.150.0150.00317.40
7.4.140.0060.01417.86
7.4.130.0110.01316.48
7.4.120.0120.00716.57
7.4.110.0070.01016.63
7.4.100.0110.01116.49
7.4.90.0060.01616.49
7.4.80.0120.00619.39
7.4.70.0060.01216.64
7.4.60.0090.00916.46
7.4.50.0050.00016.48
7.4.40.0100.00616.41
7.4.30.0070.01016.66
7.4.00.0030.01015.18
7.3.330.0060.00013.29
7.3.320.0000.00513.25
7.3.310.0060.00016.16
7.3.300.0070.00016.13
7.3.290.0080.00616.22
7.3.280.0040.01216.27
7.3.270.0030.01617.40
7.3.260.0040.01516.45
7.3.250.0130.00516.49
7.3.240.0180.00416.43
7.3.230.0090.00916.39
7.3.210.0030.01416.25
7.3.200.0150.00619.39
7.3.190.0120.00916.52
7.3.180.0100.00616.55
7.3.170.0120.00316.33
7.3.160.0110.00616.27
7.3.00.0060.00716.59
7.2.330.0140.00316.46
7.2.320.0140.00416.71
7.2.310.0100.00616.60
7.2.300.0140.00316.77
7.2.290.0100.00716.83
7.2.130.0040.00916.78
7.2.120.0080.00316.84
7.2.110.0050.00716.98
7.2.100.0050.00816.90
7.2.90.0020.01116.91
7.2.80.0070.00716.99
7.2.70.0080.00816.91
7.2.60.0030.01116.76
7.2.50.0070.01016.93
7.2.40.0130.00316.88
7.2.30.0100.00516.95
7.2.20.0030.00916.93
7.2.10.0090.00916.74
7.2.00.0050.00716.98
7.1.250.0000.01115.38
7.1.240.0060.00515.45
7.1.230.0020.01015.71
7.1.220.0000.01115.61
7.1.210.0090.00515.77
7.1.200.0060.00815.50
7.1.190.0070.00415.68
7.1.180.0030.01315.44
7.1.170.0060.00515.60
7.1.160.0080.00615.79
7.1.150.0040.01015.55
7.1.140.0020.01315.68
7.1.130.0060.00615.57
7.1.120.0080.00515.67
7.1.110.0090.00315.68
7.1.100.0080.00415.74
7.1.90.0030.00815.61
7.1.80.0050.00415.72
7.1.70.0030.00716.23
7.1.60.0040.00916.69
7.1.50.0060.01016.11
7.1.40.0060.00615.68
7.1.30.0050.00815.60
7.1.20.0050.00615.47
7.1.10.0050.00715.51
7.1.00.0060.02917.89
7.0.330.0040.00815.25
7.0.320.0060.00515.27
7.0.310.0060.00615.32
7.0.300.0030.01015.37
7.0.290.0020.00815.26
7.0.280.0070.00615.38
7.0.270.0060.00815.18
7.0.260.0030.00815.37
7.0.250.0070.00715.31
7.0.240.0070.00815.42
7.0.230.0080.00515.10
7.0.220.0050.00615.35
7.0.210.0080.00315.25
7.0.200.0070.00415.79
7.0.190.0080.00515.32
7.0.180.0070.00615.43
7.0.170.0050.00915.37
7.0.160.0050.00715.19
7.0.150.0020.01115.26
7.0.140.0070.02617.61
7.0.130.0030.00915.34
7.0.120.0030.00715.21
7.0.110.0030.01015.36
7.0.100.0050.00915.40
7.0.90.0020.01115.40
7.0.80.0050.00615.41
7.0.70.0080.00915.43
7.0.60.0120.02416.90
7.0.50.0070.03016.25
7.0.40.0020.03115.65
7.0.30.0080.02015.56
7.0.20.0120.02815.65
7.0.10.0040.02415.63
7.0.00.0120.01615.69
5.6.380.0030.00814.29
5.6.370.0060.00614.57
5.6.360.0080.00614.30
5.6.350.0090.00614.40
5.6.340.0050.00514.37
5.6.330.0050.00814.28
5.6.320.0050.00914.39
5.6.310.0020.01014.52
5.6.300.0040.00714.24
5.6.290.0050.00714.31
5.6.280.0060.00614.28
5.6.270.0050.00714.42
5.6.260.0050.00614.31
5.6.250.0070.00814.33
5.6.240.0070.00614.26
5.6.230.0050.01014.20
5.6.220.0070.00514.31
5.6.210.0050.03216.38
5.6.200.0030.02115.66
5.6.190.0070.02316.22
5.6.180.0110.03116.42
5.6.170.0550.02016.42
5.6.160.0070.03216.30
5.6.150.0050.02315.53
5.6.140.0060.03215.54
5.6.130.0060.02915.54
5.6.120.0060.03216.61
5.6.110.0100.02716.44
5.6.100.0110.02616.60
5.6.90.0060.03416.58
5.6.80.0090.02816.25
5.6.70.0040.00414.06
5.6.60.0060.00514.14
5.6.50.0080.00614.14
5.6.40.0020.01114.13
5.6.30.0070.00514.17
5.6.20.0060.00714.33
5.6.10.0030.00814.35
5.6.00.0080.00714.09
5.5.380.0020.01011.16
5.5.370.0040.00611.14
5.5.360.0040.00611.11
5.5.350.0070.01814.23
5.5.340.0070.02713.51
5.5.330.0030.02414.17
5.5.320.0170.01614.19
5.5.310.0090.01814.24
5.5.300.0070.02813.47
5.5.290.0030.02913.48
5.5.280.0070.02714.26
5.5.270.0060.03114.38
5.5.260.0030.02314.36
5.5.250.0030.03314.35
5.5.240.0060.01814.25
5.5.230.0030.00611.10
5.5.220.0070.00311.17
5.5.210.0030.00711.09
5.5.200.0050.00611.25
5.5.190.0090.00111.15
5.5.180.0030.00711.05
5.5.170.0050.00311.18
5.5.160.0020.00611.23
5.5.150.0030.00811.13
5.5.140.0030.00711.01
5.5.130.0030.00611.25
5.5.120.0070.00411.12
5.5.110.0060.00511.19
5.5.100.0030.00511.11
5.5.90.0010.00711.12
5.5.80.0040.00410.97
5.5.70.0010.00711.12
5.5.60.0060.00411.00
5.5.50.0060.00211.13
5.5.40.0020.00911.18
5.5.30.0050.00711.24
5.5.20.0040.00611.17
5.5.10.0060.00111.00
5.5.00.0030.00711.15
5.4.450.0340.02113.92
5.4.440.0360.02213.83
5.4.430.0320.02113.86
5.4.420.0230.00613.96
5.4.410.0240.00113.87
5.4.400.0230.00313.73
5.4.390.0260.00113.67
5.4.380.0230.00413.72
5.4.370.0260.00213.78
5.4.360.0280.00513.70
5.4.350.0260.00313.76
5.4.340.0060.01311.38
5.4.330.0060.00511.21
5.4.320.0030.01711.57
5.4.310.0040.01811.45
5.4.300.0030.01711.57
5.4.290.0050.01511.56
5.4.280.0080.01711.57
5.4.270.0010.01911.51
5.4.260.0070.01611.52
5.4.250.0060.01511.48
5.4.240.0070.01411.61
5.4.230.0040.01611.50
5.4.220.0040.01611.62
5.4.210.0040.02411.45
5.4.200.0050.02111.48
5.4.190.0040.02411.42
5.4.180.0050.01911.41
5.4.170.0020.02011.41
5.4.160.0050.01711.46
5.4.150.0050.01711.49
5.4.140.0070.01611.39
5.4.130.0040.01411.45
5.4.120.0040.01611.32
5.4.110.0050.01511.46
5.4.100.0050.01511.40
5.4.90.0050.01911.34
5.4.80.0060.01711.43
5.4.70.0060.01511.45
5.4.60.0030.01711.41
5.4.50.0070.01311.47
5.4.40.0020.01611.42
5.4.30.0050.01611.49
5.4.20.0030.01911.50
5.4.10.0080.01411.41
5.4.00.0060.01511.31
5.3.290.0040.01811.58
5.3.280.0040.01811.52
5.3.270.0040.01811.47
5.3.260.0060.01711.51
5.3.250.0060.01411.54
5.3.240.0050.01611.47
5.3.230.0040.01611.52
5.3.220.0040.01711.44
5.3.210.0050.01611.37
5.3.200.0050.01511.44
5.3.190.0020.01711.40
5.3.180.0030.01611.49
5.3.170.0030.01611.48
5.3.160.0040.01511.51
5.3.150.0010.02011.50
5.3.140.0050.01611.48
5.3.130.0060.01711.47
5.3.120.0040.02111.47
5.3.110.0070.01811.51
5.3.100.0060.01411.28
5.3.90.0030.01611.25
5.3.80.0050.01711.24
5.3.70.0060.01411.26
5.3.60.0040.01611.28
5.3.50.0030.01611.27
5.3.40.0030.01511.17
5.3.30.0010.01711.25
5.3.20.0010.01811.13
5.3.10.0040.01611.12
5.3.00.0080.01611.05
5.2.170.0020.01810.22
5.2.160.0020.01810.22
5.2.150.0070.01210.22
5.2.140.0060.01510.22
5.2.130.0040.01510.21
5.2.120.0040.01710.21
5.2.110.0050.01410.21
5.2.100.0040.01510.21
5.2.90.0050.02210.21
5.2.80.0040.01510.21
5.2.70.0010.01710.21
5.2.60.0060.01110.19
5.2.50.0030.01410.18
5.2.40.0040.01610.17
5.2.30.0020.01610.17
5.2.20.0040.01610.16
5.2.10.0040.01210.13
5.2.00.0050.01210.09
5.1.60.0010.0129.84
5.1.50.0030.0129.84
5.1.40.0050.0119.84
5.1.30.0040.0139.96
5.1.20.0040.0109.96
5.1.10.0020.0129.87
5.1.00.0020.0129.87
5.0.50.0030.0109.36
5.0.40.0030.0109.32
5.0.30.0020.0149.25
5.0.20.0000.0129.24
5.0.10.0020.0109.24
5.0.00.0050.0119.23
4.4.90.0010.0098.74
4.4.80.0040.0068.73
4.4.70.0030.0078.73
4.4.60.0020.0098.73
4.4.50.0020.0088.73
4.4.40.0020.0118.71
4.4.30.0020.0088.73
4.4.20.0040.0078.76
4.4.10.0020.0088.76
4.4.00.0030.0108.73
4.3.110.0020.0088.70
4.3.100.0010.0088.70
4.3.90.0020.0088.69
4.3.80.0020.0118.67
4.3.70.0020.0078.69
4.3.60.0020.0078.68
4.3.50.0020.0078.69
4.3.40.0030.0108.66
4.3.30.0030.0078.24
4.3.20.0010.0078.23
4.3.10.0030.0078.22
4.3.00.0030.0109.83

preferences:
38.66 ms | 400 KiB | 5 Q