3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface CounterInterface { public function getCount(); public function increment(); } class Counter implements CounterInterface { private $counter = 0; public function getCount() { return $this->counter; } public function increment() { $this->counter = $this->getCount() + 1; } } class CounterOffsetByOne extends Counter { public function getCount() { return parent::getCount() + 1; } } class DecoratedCounterOffsetByOne implements CounterInterface { private $baseCounter; public function __construct() { $this->baseCounter = new Counter; } public function getCount() { return $this->baseCounter->getCount() + 1; } public function increment() { $this->baseCounter->increment(); } } $counter = new CounterOffsetByOne; $counter->increment(); $counter->increment(); var_dump($counter->getCount()); $counter = new DecoratedCounterOffsetByOne; $counter->increment(); $counter->increment(); var_dump($counter->getCount());

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.40.0030.01418.89
8.3.30.0100.00718.38
8.3.20.0050.00320.34
8.3.10.0000.00823.61
8.3.00.0080.00019.13
8.2.170.0040.01122.96
8.2.160.0090.00620.38
8.2.150.0040.00424.18
8.2.140.0070.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00420.62
8.2.110.0060.00320.52
8.2.100.0110.00017.92
8.2.90.0040.00419.23
8.2.80.0060.00317.97
8.2.70.0060.00617.50
8.2.60.0040.00417.80
8.2.50.0080.00018.07
8.2.40.0000.00819.46
8.2.30.0030.00720.63
8.2.20.0030.00617.69
8.2.10.0060.00318.15
8.2.00.0040.00418.07
8.1.270.0070.00323.61
8.1.260.0020.00526.35
8.1.250.0050.00328.09
8.1.240.0030.00623.92
8.1.230.0120.00017.66
8.1.220.0000.00817.79
8.1.210.0080.00018.77
8.1.200.0040.00417.35
8.1.190.0060.00317.63
8.1.180.0000.00818.10
8.1.170.0000.00918.46
8.1.160.0040.00421.95
8.1.150.0040.00418.82
8.1.140.0000.00819.50
8.1.130.0030.00317.64
8.1.120.0030.00517.52
8.1.110.0000.00817.48
8.1.100.0040.00417.38
8.1.90.0090.00017.54
8.1.80.0020.00517.48
8.1.70.0050.00217.33
8.1.60.0080.00017.50
8.1.50.0040.00417.52
8.1.40.0050.00317.50
8.1.30.0030.00617.71
8.1.20.0040.00417.61
8.1.10.0050.00317.56
8.1.00.0040.00417.48
8.0.300.0030.00618.77
8.0.290.0070.00016.75
8.0.280.0070.00018.46
8.0.270.0030.00317.34
8.0.260.0000.00617.38
8.0.250.0000.00716.91
8.0.240.0000.00717.04
8.0.230.0030.00316.86
8.0.220.0040.00416.95
8.0.210.0040.00416.95
8.0.200.0070.00016.84
8.0.190.0040.00416.98
8.0.180.0040.00416.94
8.0.170.0040.00416.91
8.0.160.0050.00216.81
8.0.150.0040.00316.82
8.0.140.0050.00216.79
8.0.130.0030.00313.33
8.0.120.0080.00016.88
8.0.110.0040.00416.80
8.0.100.0040.00416.95
8.0.90.0030.00516.78
8.0.80.0030.01316.93
8.0.70.0070.00016.84
8.0.60.0000.00816.98
8.0.50.0000.00716.69
8.0.30.0120.00416.86
8.0.20.0070.01217.40
8.0.10.0040.00416.96
8.0.00.0070.01116.85
7.4.330.0000.00616.78
7.4.320.0000.00716.61
7.4.300.0000.00616.44
7.4.290.0070.00016.51
7.4.280.0070.00016.46
7.4.270.0040.00416.38
7.4.260.0000.00716.48
7.4.250.0000.00716.55
7.4.240.0030.00516.56
7.4.230.0070.00016.61
7.4.220.0060.01616.49
7.4.210.0030.01716.51
7.4.200.0070.00016.51
7.4.160.0070.00716.48
7.4.150.0080.00817.40
7.4.140.0110.01317.86
7.4.130.0140.00616.49
7.4.120.0080.01116.48
7.4.110.0030.01616.37
7.4.100.0070.01016.35
7.4.90.0120.00616.38
7.4.80.0120.00819.39
7.4.70.0130.00316.43
7.4.60.0150.00016.61
7.4.50.0060.00616.69
7.4.40.0090.00616.32
7.4.30.0000.02016.63
7.4.00.0050.01314.95
7.3.330.0060.00013.14
7.3.320.0030.00313.29
7.3.310.0040.00416.38
7.3.300.0030.00316.25
7.3.290.0090.00716.30
7.3.280.0110.00516.35
7.3.270.0030.01317.40
7.3.260.0110.00516.29
7.3.250.0100.00716.39
7.3.240.0090.00816.33
7.3.230.0090.00916.64
7.3.210.0030.01416.32
7.3.200.0070.01116.62
7.3.190.0110.00816.58
7.3.180.0040.01216.50
7.3.170.0120.00616.52
7.3.160.0100.01016.35
7.3.120.0090.00914.67
7.3.110.0090.00914.98
7.3.100.0030.00714.77
7.3.90.0060.00614.77
7.3.80.0000.01114.95
7.3.70.0000.01614.96
7.3.60.0100.00314.95
7.3.50.0040.01514.72
7.3.40.0060.01214.64
7.3.30.0030.01014.57
7.3.20.0040.00816.45
7.3.10.0040.01116.46
7.3.00.0150.00716.55
7.2.330.0030.01516.57
7.2.320.0110.01216.43
7.2.310.0100.00616.76
7.2.300.0060.01216.64
7.2.290.0060.01016.47
7.2.250.0080.01215.30
7.2.240.0110.01115.35
7.2.230.0100.00315.26
7.2.220.0000.01314.65
7.2.210.0060.00615.05
7.2.200.0060.00914.89
7.2.190.0070.00715.16
7.2.180.0070.01315.10
7.2.170.0000.01414.94
7.2.130.0270.00816.66
7.2.120.0180.00416.51
7.2.110.0410.00016.68
7.2.100.0120.01216.39
7.2.90.0260.01216.63
7.2.80.0180.00316.50
7.2.70.0130.00616.63
7.2.60.0220.00616.62
7.2.50.0150.00716.29
7.2.40.0130.01316.95
7.2.30.0070.00416.43
7.2.20.0110.00416.77
7.2.10.0080.00016.60
7.2.00.0040.00918.02
7.1.330.0090.00615.58
7.1.320.0000.01115.76
7.1.310.0060.00615.86
7.1.300.0070.01115.72
7.1.290.0060.01015.66
7.1.280.0040.00715.64
7.1.270.0070.01015.54
7.1.260.0030.00915.78
7.1.250.0230.00415.30
7.1.100.0030.00917.95
7.1.70.0030.00616.80
7.1.60.0090.00619.36
7.1.50.0060.01616.98
7.1.00.0100.07022.35
7.0.200.0000.00816.47
7.0.60.0100.06320.02
7.0.50.0070.08317.87
7.0.40.0100.04320.24
7.0.30.0230.04020.24
7.0.20.0370.07720.10
7.0.10.0100.08320.33
7.0.00.0030.04320.05
5.6.280.0070.06021.14
5.6.210.0000.08720.54
5.6.200.0030.06018.19
5.6.190.0070.04020.63
5.6.180.0330.07720.35
5.6.170.0270.07320.40
5.6.160.0030.09020.71
5.6.150.0070.03718.25
5.6.140.0070.05318.28
5.6.130.0070.08318.30
5.6.120.0130.07321.16
5.6.110.0030.08721.02
5.6.100.0070.08321.09
5.6.90.0030.04020.96
5.6.80.0070.06720.54
5.5.350.0270.07020.39
5.5.340.0130.04718.07
5.5.330.0030.07020.27
5.5.320.0030.04020.36
5.5.310.0370.07320.34
5.5.300.0070.07017.98
5.5.290.0070.08018.05
5.5.280.0000.04320.79
5.5.270.0070.08020.80
5.5.260.0100.06320.78
5.5.250.0100.03720.56
5.5.240.3730.03720.27

preferences:
40.29 ms | 400 KiB | 5 Q