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)
5.4.340.0070.03312.04
5.4.320.0070.03512.54
5.4.310.0070.03812.53
5.4.300.0080.03612.53
5.4.290.0050.04412.52
5.4.280.0080.03812.41
5.4.270.0060.03612.42
5.4.260.0100.03412.42
5.4.250.0040.04012.42
5.4.240.0080.03512.42
5.4.230.0070.04012.41
5.4.220.0080.04912.41
5.4.210.0140.04212.41
5.4.200.0060.04012.41
5.4.190.0060.04512.41
5.4.180.0080.03512.40
5.4.170.0080.03312.41
5.4.160.0060.03512.41
5.4.150.0080.03312.41
5.4.140.0060.03712.10
5.4.130.0070.04312.08
5.4.120.0100.03312.05
5.4.110.0050.03512.04
5.4.100.0060.04212.04
5.4.90.0040.04112.04
5.4.80.0060.03712.04
5.4.70.0050.03512.03
5.4.60.0090.03212.04
5.4.50.0040.03812.03
5.4.40.0050.03612.02
5.4.30.0040.04012.02
5.4.20.0070.03412.02
5.4.10.0060.03412.02
5.4.00.0070.03511.51
5.3.290.0090.03712.80
5.3.280.0060.03812.71
5.3.270.0070.03712.73
5.3.260.0070.03812.72
5.3.250.0040.04212.72
5.3.240.0060.03712.72
5.3.230.0040.04012.70
5.3.220.0060.04212.68
5.3.210.0140.04612.68
5.3.200.0090.03412.68
5.3.190.0070.03712.68
5.3.180.0080.03812.67
5.3.170.0060.04012.67
5.3.160.0070.03512.68
5.3.150.0060.03812.68
5.3.140.0050.04112.66
5.3.130.0040.04512.66
5.3.120.0090.03912.66
5.3.110.0050.03912.66
5.3.100.0050.03812.14
5.3.90.0060.03812.12
5.3.80.0070.03512.11
5.3.70.0080.03412.11
5.3.60.0070.03512.09
5.3.50.0080.04712.04
5.3.40.0040.03812.04
5.3.30.0070.03312.00
5.3.20.0080.03311.78
5.3.10.0030.03611.75
5.3.00.0050.03611.73
5.2.170.0030.0329.23
5.2.160.0060.0289.23
5.2.150.0030.0339.24
5.2.140.0050.0319.23
5.2.130.0060.0289.20
5.2.120.0040.0319.19
5.2.110.0050.0299.20
5.2.100.0060.0349.20
5.2.90.0050.0299.19
5.2.80.0080.0259.19
5.2.70.0090.0339.19
5.2.60.0050.0299.14
5.2.50.0100.0359.11
5.2.40.0030.0299.09
5.2.30.0070.0389.07
5.2.20.0090.0259.05
5.2.10.0050.0328.96
5.2.00.0050.0338.83
5.1.60.0040.0248.11
5.1.50.0020.0268.10
5.1.40.0040.0248.09
5.1.30.0050.0308.43
5.1.20.0030.0298.46
5.1.10.0050.0258.18
5.1.00.0040.0258.18
5.0.50.0020.0216.66
5.0.40.0020.0206.52
5.0.30.0030.0316.33
5.0.20.0020.0206.29
5.0.10.0010.0226.28
5.0.00.0070.0276.27
4.4.90.0020.0164.78
4.4.80.0030.0154.76
4.4.70.0040.0144.75
4.4.60.0040.0144.75
4.4.50.0030.0154.77
4.4.40.0020.0254.71
4.4.30.0070.0104.76
4.4.20.0040.0144.85
4.4.10.0040.0144.84
4.4.00.0040.0234.76
4.3.110.0050.0134.67
4.3.100.0050.0134.66
4.3.90.0030.0144.63
4.3.80.0030.0244.58
4.3.70.0040.0134.63
4.3.60.0040.0134.63
4.3.50.0020.0174.63
4.3.40.0040.0224.54
4.3.30.0030.0153.28
4.3.20.0030.0153.26
4.3.10.0010.0173.22
4.3.00.0130.0238.06

preferences:
141.95 ms | 1394 KiB | 7 Q