3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Counter { /** @return self */ public function count(); /** @return int */ public function getCount(); } class EchoingCounter implements Counter { private $counter; public function __construct(Counter $counter) { $this->counter = $counter; } public function count() { echo __METHOD__ . "\n"; return $this->counter->count(); } public function getCount() { echo __METHOD__ . "\n"; return $this->counter->getCount(); } } class ImmutableCounter implements Counter { private $count; public function __construct($count = 0) { $this->count = (int) $count; } public function count() { return new ImmutableCounter($this->count + 1); } public function getCount() { return $this->count; } } $counter = new EchoingCounter(new ImmutableCounter()); $counter = $counter->count()->count()->count()->count(); echo $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.4.20.0130.00717.40
8.4.10.0030.00517.80
8.3.150.0110.00717.02
8.3.140.0000.00716.65
8.3.130.0070.01116.85
8.3.120.0120.00319.10
8.3.110.0130.00320.94
8.3.100.0090.00624.06
8.3.90.0040.00426.77
8.3.80.0100.00016.75
8.3.70.0100.01016.63
8.3.60.0100.01018.36
8.3.50.0130.00721.15
8.3.40.0150.00618.59
8.3.30.0100.00320.34
8.3.20.0050.00318.82
8.3.10.0090.00021.16
8.3.00.0040.00423.54
8.2.260.0100.00719.02
8.2.250.0070.00017.36
8.2.240.0030.01717.42
8.2.230.0080.00022.58
8.2.220.0030.00637.54
8.2.210.0000.00926.77
8.2.200.0090.00016.75
8.2.190.0060.01216.58
8.2.180.0070.00725.92
8.2.170.0150.00018.96
8.2.160.0130.00722.96
8.2.150.0050.00224.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00421.04
8.2.110.0040.00422.38
8.2.100.0090.00317.59
8.2.90.0040.00417.84
8.2.80.0050.00318.16
8.2.70.0040.00417.63
8.2.60.0040.00417.63
8.2.50.0040.00418.10
8.2.40.0040.00421.02
8.2.30.0040.00419.30
8.2.20.0030.00517.53
8.2.10.0000.00817.61
8.2.00.0070.00017.67
8.1.310.0040.00416.67
8.1.300.0050.00316.04
8.1.290.0040.00418.88
8.1.280.0070.00725.92
8.1.270.0120.00424.66
8.1.260.0050.00326.35
8.1.250.0110.00328.09
8.1.240.0070.00323.61
8.1.230.0090.00322.70
8.1.220.0030.00617.74
8.1.210.0000.00918.77
8.1.200.0060.00317.36
8.1.190.0000.00817.35
8.1.180.0060.00318.10
8.1.170.0040.00418.65
8.1.160.0000.00920.67
8.1.150.0000.00818.84
8.1.140.0030.00517.43
8.1.130.0070.00017.49
8.1.120.0040.00417.52
8.1.110.0040.00417.46
8.1.100.0040.00417.41
8.1.90.0040.00417.48
8.1.80.0040.00417.45
8.1.70.0040.00417.48
8.1.60.0000.00817.48
8.1.50.0040.00417.48
8.1.40.0000.00817.53
8.1.30.0040.00417.66
8.1.20.0040.00417.59
8.1.10.0000.00817.52
8.1.00.0060.00617.53
8.0.300.0000.00720.02
8.0.290.0040.00416.75
8.0.280.0000.00718.46
8.0.270.0080.00017.17
8.0.260.0030.00316.83
8.0.250.0080.00017.04
8.0.240.0020.00517.02
8.0.230.0030.00316.93
8.0.220.0070.00016.88
8.0.210.0050.00316.97
8.0.200.0000.00717.05
8.0.190.0050.00217.01
8.0.180.0070.00016.84
8.0.170.0000.00716.88
8.0.160.0000.00716.90
8.0.150.0040.00416.91
8.0.140.0000.00716.97
8.0.130.0060.00013.48
8.0.120.0070.00016.81
8.0.110.0050.00216.83
8.0.100.0000.00716.92
8.0.90.0040.00416.83
8.0.80.0000.02016.94
8.0.70.0070.00016.93
8.0.60.0000.00816.84
8.0.50.0030.00516.91
8.0.30.0100.00917.18
8.0.20.0180.00017.40
8.0.10.0070.00017.11
8.0.00.0120.01016.69
7.4.330.0000.00514.91
7.4.320.0000.00716.61
7.4.300.0000.00616.55
7.4.290.0040.00816.53
7.4.280.0030.00316.58
7.4.270.0020.00516.41
7.4.260.0030.00313.32
7.4.250.0020.00516.57
7.4.240.0030.00316.50
7.4.230.0000.00716.26
7.4.220.0110.00716.47
7.4.210.0050.01216.54
7.4.200.0070.00016.55
7.4.190.0050.00316.46
7.4.160.0080.00816.50
7.4.150.0100.00717.40
7.4.140.0050.01317.86
7.4.130.0130.00416.50
7.4.120.0080.01116.41
7.4.110.0090.01116.53
7.4.100.0150.00816.52
7.4.90.0060.01416.41
7.4.80.0110.01117.88
7.4.70.0140.00716.43
7.4.60.0100.00816.52
7.4.50.0080.01016.50
7.4.40.0060.01319.66
7.4.30.0080.01116.37
7.4.20.0060.01116.37
7.4.10.0090.01216.51
7.4.00.0100.00715.76
7.3.330.0000.00713.17
7.3.320.0000.00513.30
7.3.310.0030.00316.40
7.3.300.0080.00016.29
7.3.290.0100.00316.21
7.3.280.0080.00716.28
7.3.270.0080.00817.40
7.3.260.0120.00718.24
7.3.250.0070.01016.45
7.3.240.0080.00816.42
7.3.230.0100.00916.45
7.3.220.0090.01216.34
7.3.210.0090.01016.21
7.3.200.0130.00617.98
7.3.190.0090.01016.46
7.3.180.0160.01116.31
7.3.170.0120.01016.45
7.3.160.0130.00716.39
7.3.150.0140.01016.46
7.3.140.0050.01316.22
7.3.130.0060.01316.50
7.3.120.0100.01315.74
7.3.110.0190.00316.15
7.3.100.0310.00016.46
7.3.90.0190.01316.55
7.3.80.0250.00716.39
7.3.70.0230.01216.28
7.3.60.0230.00816.42
7.3.50.0250.01116.41
7.3.40.0260.00416.15
7.3.30.0060.01116.18
7.3.20.0090.00916.32
7.3.10.0080.00916.38
7.3.00.0040.01516.39
7.2.340.0140.00916.61
7.2.330.0110.01016.61
7.2.320.0080.01216.62
7.2.310.0090.01316.69
7.2.300.0110.01316.60
7.2.290.0070.01516.59
7.2.280.0180.00716.25
7.2.270.0140.01416.26
7.2.260.0180.01216.41
7.2.250.0230.00316.15
7.2.240.0160.00816.30
7.2.230.0000.02216.77
7.2.220.0140.00516.79
7.2.210.0120.00816.57
7.2.200.0100.01216.64
7.2.190.0100.01016.56
7.2.180.0190.00516.50
7.2.170.0130.00716.66
7.2.160.0030.01816.80
7.2.150.0180.00416.50
7.2.140.0070.01116.61
7.2.130.0110.00816.70
7.2.120.0120.00816.73
7.2.110.0100.01016.66
7.2.100.0050.01416.77
7.2.90.0110.01116.72
7.2.80.0110.00816.51
7.2.70.0180.00816.66
7.2.60.0110.00816.81
7.2.50.0160.00916.68
7.2.40.0130.01316.91
7.2.30.0270.01816.71
7.2.20.0110.01116.82
7.2.10.0210.00917.29
7.2.00.0170.01117.08
7.1.330.0170.01415.54
7.1.320.0170.01115.58
7.1.310.0210.01115.51
7.1.300.0230.00615.59
7.1.290.0240.00815.53
7.1.280.0140.01415.46
7.1.270.0160.01315.56
7.1.260.1220.01115.51
7.1.250.0200.00815.34
7.1.240.0190.01515.58
7.1.230.0290.00015.49
7.1.220.0180.00915.57
7.1.210.0280.00415.52
7.1.200.0160.00415.56
7.1.190.0190.00915.55
7.1.180.0220.00815.54
7.1.170.0310.01015.59
7.1.160.0320.00415.56
7.1.150.0300.01015.63
7.1.140.0230.00715.59
7.1.130.0160.01216.02
7.1.120.0200.00916.17
7.1.110.0150.01515.82
7.1.100.0180.00915.75
7.1.90.0180.00815.82
7.1.80.0180.00715.47
7.1.70.0140.00715.96
7.1.60.0180.00922.72
7.1.50.0240.01427.65
7.1.40.0220.01024.18
7.1.30.0250.01024.03
7.1.20.0240.00724.14
7.1.10.0170.01015.22
7.1.00.0140.01617.58
7.0.330.0150.01115.23
7.0.320.0200.00715.14
7.0.310.0150.01115.22
7.0.300.0180.00915.28
7.0.290.0220.00815.22
7.0.280.0220.01015.18
7.0.270.0160.01315.80
7.0.260.0180.01115.86
7.0.250.0150.00915.64
7.0.240.0200.00815.49
7.0.230.0130.01215.37
7.0.220.0580.00515.57
7.0.210.0210.00815.16
7.0.200.0110.00815.53
7.0.190.0180.00815.10
7.0.180.0170.00614.91
7.0.170.0170.00914.88
7.0.160.0150.00814.80
7.0.150.0120.01514.82
7.0.140.0150.02717.23
7.0.130.0420.01014.98
7.0.120.0200.00914.95
7.0.110.0150.00914.90
7.0.100.0180.00514.95
7.0.90.0190.00514.84
7.0.80.0170.00715.02
7.0.70.0130.03117.17
7.0.60.0110.03317.13
7.0.50.0150.03017.23
7.0.40.0540.02516.64
7.0.30.0130.02816.64
7.0.20.0130.03616.71
7.0.10.0140.03316.64
7.0.00.0140.03516.64
5.6.400.0150.01515.70
5.6.390.0190.01015.79
5.6.380.0130.01616.05
5.6.370.0180.00916.07
5.6.360.0290.00316.19
5.6.350.0280.00515.91
5.6.340.0230.00616.05
5.6.330.0220.00915.98
5.6.320.0240.01416.07
5.6.310.0160.01316.02
5.6.300.0170.03718.43
5.6.290.0150.03618.30
5.6.280.0180.04119.42
5.6.270.0160.03618.39
5.6.260.0230.02518.25
5.6.250.0150.03318.31
5.6.240.0160.04318.53
5.6.230.0140.03518.37
5.6.220.0140.04019.15
5.6.210.0120.05219.20
5.6.200.0140.05419.38
5.6.190.0110.04219.20
5.6.180.0100.06019.40
5.6.170.0140.05619.23
5.6.160.0130.05419.23
5.6.150.0130.05419.41
5.6.140.0150.05219.31
5.6.130.0150.04619.22
5.6.120.0130.05119.29
5.6.110.0180.04719.21
5.6.100.0170.04719.25
5.6.90.0110.05019.27
5.6.80.0190.04318.78
5.6.70.0070.04518.85
5.6.60.0110.04418.91
5.6.50.0110.04518.82
5.6.40.0120.04618.84
5.6.30.0190.03618.81
5.6.20.0110.04018.79
5.6.10.0120.05418.86
5.6.00.0120.04318.76
5.5.380.0110.03816.77
5.5.370.0110.03716.85
5.5.360.0090.05217.88
5.5.350.0120.05717.96
5.5.340.0170.04618.20
5.5.330.0140.04518.23
5.5.320.0140.04818.22
5.5.310.0120.04818.36
5.5.300.0140.05218.26
5.5.290.0090.05318.24
5.5.280.0140.04318.29
5.5.270.0120.05518.26
5.5.260.0130.03918.23
5.5.250.0130.04818.19
5.5.240.0110.04417.91
5.5.230.0160.04217.74
5.5.220.0110.04717.79
5.5.210.0100.04617.81
5.5.200.0130.04717.78
5.5.190.0080.04917.80
5.5.180.0100.05717.65
5.5.170.0170.01215.89
5.5.160.0110.04517.74
5.5.150.0190.04717.84
5.5.140.0100.05217.71
5.5.130.0120.04817.68
5.5.120.0120.04917.79
5.5.110.0170.04617.85
5.5.100.0110.04917.78
5.5.90.0160.03417.70
5.5.80.0140.04417.63
5.5.70.0060.05417.75
5.5.60.0120.03717.80
5.5.50.0150.04417.70
5.5.40.0120.03817.78
5.5.30.0160.03617.65
5.5.20.0130.03517.76
5.5.10.0090.03717.74
5.5.00.0120.04517.74
5.4.450.0100.04617.84
5.4.440.0110.05517.88
5.4.430.0140.04817.77
5.4.420.0080.04617.87
5.4.410.0110.04117.82
5.4.400.0110.04417.66
5.4.390.0060.04817.75
5.4.380.0090.04217.75
5.4.370.0160.03417.69
5.4.360.0150.03917.67
5.4.350.0080.04917.63
5.4.340.0120.04217.73
5.4.330.0180.00514.88
5.4.320.0100.03817.63
5.4.310.0130.04717.71
5.4.300.0110.04117.68
5.4.290.0100.04017.63
5.4.280.0120.04817.63
5.4.270.0090.04717.59
5.4.260.0100.04417.57
5.4.250.0100.04017.69
5.4.240.0160.03817.68
5.4.230.0160.04217.68
5.4.220.0080.05517.60
5.4.210.0090.04817.60
5.4.200.0110.04517.69
5.4.190.0130.04317.62
5.4.180.0140.04117.64
5.4.170.0120.04117.72
5.4.160.0080.04517.69
5.4.150.0080.04417.67
5.4.140.0060.04515.91
5.4.130.0120.04115.94
5.4.120.0160.03615.99
5.4.110.0110.03616.06
5.4.100.0150.03316.04
5.4.90.0100.03816.04
5.4.80.0100.03416.00
5.4.70.0130.04215.98
5.4.60.0080.04415.95
5.4.50.0090.03816.00
5.4.40.0090.03515.95
5.4.30.0110.03215.95
5.4.20.0110.04115.96
5.4.10.0090.04415.90
5.4.00.0110.03115.52
5.3.290.0100.04114.84
5.3.280.0110.04214.79
5.3.270.0080.04614.76
5.3.260.0110.04714.77
5.3.250.0080.04514.81
5.3.240.0110.04414.75
5.3.230.0130.04714.64
5.3.220.0120.03114.75
5.3.210.0100.03314.79
5.3.200.0110.03914.75
5.3.190.0090.04514.66
5.3.180.0050.04514.74
5.3.170.0100.04514.68
5.3.160.0060.04614.69
5.3.150.0120.03714.72
5.3.140.0090.04714.77
5.3.130.0080.03814.71
5.3.120.0090.04314.68
5.3.110.0080.04514.70
5.3.100.0080.04514.43
5.3.90.0100.04514.42
5.3.80.0100.04214.35
5.3.70.0120.04014.34
5.3.60.0070.03814.31
5.3.50.0140.04014.33
5.3.40.0080.04414.31
5.3.30.0070.04414.25
5.3.20.0120.03314.17
5.3.10.0100.04114.08
5.3.00.0100.04014.04

preferences:
76.07 ms | 403 KiB | 5 Q