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"; $this->counter->count(); return $this; } 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.3.130.0110.00718.53
8.3.120.0080.00018.98
8.3.110.0040.00718.21
8.3.100.0080.00816.56
8.3.90.0000.00826.77
8.3.80.0090.00016.50
8.3.70.0170.00316.63
8.3.60.0100.01018.43
8.3.50.0100.00521.09
8.3.40.0040.01118.83
8.3.30.0090.00918.57
8.3.20.0030.00518.73
8.3.10.0080.00021.22
8.3.00.0040.00419.81
8.2.250.0120.00316.39
8.2.240.0150.00320.81
8.2.230.0000.00820.94
8.2.220.0040.00424.06
8.2.210.0140.00726.77
8.2.200.0090.00316.38
8.2.190.0110.00316.63
8.2.180.0130.00725.92
8.2.170.0110.00422.96
8.2.160.0100.00722.20
8.2.150.0040.00424.18
8.2.140.0000.00924.66
8.2.130.0080.00026.16
8.2.120.0040.00417.63
8.2.110.0080.00019.37
8.2.100.0090.00317.53
8.2.90.0040.00417.97
8.2.80.0080.00017.97
8.2.70.0060.00317.63
8.2.60.0040.00417.80
8.2.50.0060.00318.07
8.2.40.0080.00018.22
8.2.30.0070.00018.04
8.2.20.0080.00017.71
8.2.10.0030.00517.69
8.2.00.0070.00417.67
8.1.300.0130.00716.76
8.1.290.0060.00330.84
8.1.280.0100.00725.92
8.1.270.0080.00023.99
8.1.260.0040.00428.09
8.1.250.0040.00428.09
8.1.240.0030.00722.45
8.1.230.0070.00420.68
8.1.220.0000.00817.74
8.1.210.0080.00019.02
8.1.200.0080.00017.35
8.1.190.0000.00817.35
8.1.180.0080.00018.10
8.1.170.0000.00818.44
8.1.160.0030.00618.91
8.1.150.0040.00418.67
8.1.140.0040.00417.57
8.1.130.0030.00317.80
8.1.120.0040.00417.48
8.1.110.0050.00217.49
8.1.100.0030.00517.45
8.1.90.0080.00317.41
8.1.80.0050.00617.40
8.1.70.0070.00417.38
8.1.60.0060.00417.54
8.1.50.0030.00717.46
8.1.40.0070.00517.45
8.1.30.0050.00617.59
8.1.20.0080.00417.60
8.1.10.0020.01117.50
8.1.00.0070.00517.50
8.0.300.0040.00419.98
8.0.290.0040.00416.75
8.0.280.0000.00820.16
8.0.270.0040.00416.81
8.0.260.0040.00216.93
8.0.250.0000.00717.04
8.0.240.0040.00417.04
8.0.230.0040.00416.90
8.0.220.0050.00616.97
8.0.210.0080.00316.95
8.0.200.0080.00316.97
8.0.190.0060.00517.00
8.0.180.0060.00516.83
8.0.170.0110.00016.98
8.0.160.0040.00416.97
8.0.150.0040.00416.93
8.0.140.0040.00516.80
8.0.130.0040.00515.10
8.0.120.0040.00616.99
8.0.110.0080.00417.00
8.0.100.0050.00516.92
8.0.90.0080.00216.91
8.0.80.0050.01116.89
8.0.70.0060.00416.93
8.0.60.0030.00616.86
8.0.50.0060.00416.86
8.0.30.0090.00916.88
8.0.20.0090.00917.20
8.0.10.0130.01016.94
8.0.00.0110.00916.94
7.4.330.0000.00516.70
7.4.320.0000.00716.61
7.4.300.0010.00516.53
7.4.290.0080.00416.59
7.4.280.0100.00116.50
7.4.270.0080.00416.59
7.4.260.0060.00514.91
7.4.250.0070.00516.36
7.4.240.0070.00416.55
7.4.230.0120.00116.43
7.4.220.0100.00716.48
7.4.210.0100.00516.53
7.4.200.0050.00516.63
7.4.190.0050.00616.47
7.4.180.0070.00416.65
7.4.160.0080.00916.47
7.4.150.0070.00816.73
7.4.140.0140.00517.00
7.4.130.0130.01116.39
7.4.120.0090.01016.40
7.4.110.0090.01016.44
7.4.100.0150.00516.43
7.4.90.0140.00516.31
7.4.80.0130.00817.21
7.4.70.0130.00616.10
7.4.60.0090.01116.16
7.4.50.0080.00916.34
7.4.40.0110.00718.47
7.4.30.0100.01116.34
7.4.20.0120.00816.26
7.4.10.0150.00616.29
7.4.00.0060.01115.93
7.3.330.0070.00414.81
7.3.320.0020.00814.56
7.3.310.0090.00216.20
7.3.300.0070.00416.26
7.3.290.0110.00616.30
7.3.280.0110.00716.24
7.3.270.0150.00816.59
7.3.260.0120.00817.46
7.3.250.0130.00816.44
7.3.240.0170.00516.36
7.3.230.0130.00816.33
7.3.220.0180.00316.22
7.3.210.0150.00616.22
7.3.200.0120.01117.29
7.3.190.0100.01216.26
7.3.180.0140.00516.31
7.3.170.0130.00816.24
7.3.160.0160.00616.29
7.3.150.0170.00616.12
7.3.140.0190.00416.28
7.3.130.0130.00816.22
7.3.120.0140.00715.68
7.3.110.0110.00916.14
7.3.100.0140.00916.20
7.3.90.0170.00416.39
7.3.80.0190.00216.19
7.3.70.0160.00616.34
7.3.60.0170.00516.35
7.3.50.0160.00516.39
7.3.40.0160.00616.45
7.3.30.0120.00816.43
7.3.20.0170.00516.44
7.3.10.0160.00616.42
7.3.00.0160.00616.45
7.2.340.0070.01116.38
7.2.330.0160.00616.41
7.2.320.0130.01016.57
7.2.310.0140.00816.58
7.2.300.0150.00516.45
7.2.290.0150.00816.53
7.2.280.0120.01016.39
7.2.270.0130.00916.33
7.2.260.0160.00816.46
7.2.250.0140.00716.41
7.2.240.0140.00616.50
7.2.230.0070.01516.42
7.2.220.0150.01216.37
7.2.210.0210.00216.43
7.2.200.0190.00316.52
7.2.190.0160.00716.46
7.2.180.0130.00816.48
7.2.170.0140.00916.61
7.2.160.0200.00016.64
7.2.150.0130.00916.65
7.2.140.0150.00516.64
7.2.130.0130.00816.82
7.2.120.0140.00716.70
7.2.110.0090.01216.79
7.2.100.0460.00716.74
7.2.90.0190.00216.56
7.2.80.0170.00616.67
7.2.70.0150.00616.55
7.2.60.0180.00516.71
7.2.50.0100.01116.62
7.2.40.0150.01016.63
7.2.30.0180.00716.75
7.2.20.0150.00916.72
7.2.10.0260.00816.64
7.2.00.0080.01116.80
7.1.330.0200.00315.52
7.1.320.0250.00715.52
7.1.310.0120.00915.56
7.1.300.0170.00615.53
7.1.290.0140.00515.58
7.1.280.0200.00515.53
7.1.270.0130.00715.56
7.1.260.0190.00115.52
7.1.250.0160.00715.46
7.1.240.0090.01015.51
7.1.230.0130.00915.60
7.1.220.0130.00815.54
7.1.210.0190.00115.62
7.1.200.0100.00915.64
7.1.190.0160.00415.57
7.1.180.0260.00515.42
7.1.170.0140.00915.52
7.1.160.0150.00615.40
7.1.150.0140.00815.48
7.1.140.0140.00615.49
7.1.130.0080.01215.44
7.1.120.0100.01015.54
7.1.110.0150.00815.49
7.1.100.0170.00615.40
7.1.90.0130.00615.38
7.1.80.0140.00615.56
7.1.70.0110.00915.92
7.1.60.0150.00415.92
7.1.50.0560.00715.96
7.1.40.0180.00415.42
7.1.30.0340.00315.56
7.1.20.0140.00515.55
7.1.10.0130.00715.54
7.1.00.0100.02417.75
7.0.330.0130.00815.24
7.0.320.0180.00415.21
7.0.310.0130.00615.28
7.0.300.0190.00915.23
7.0.290.0130.00915.17
7.0.280.0140.00815.30
7.0.270.0260.01015.09
7.0.260.0110.00915.19
7.0.250.0120.00715.44
7.0.240.0160.00315.37
7.0.230.0130.00715.30
7.0.220.0160.00515.24
7.0.210.0150.00515.31
7.0.200.0100.00615.82
7.0.190.0140.00815.19
7.0.180.0160.00515.32
7.0.170.0120.00715.43
7.0.160.0150.00415.30
7.0.150.0150.00415.30
7.0.140.0100.02917.48
7.0.130.0160.00315.29
7.0.120.0270.00615.09
7.0.110.0110.00915.30
7.0.100.0120.00715.22
7.0.90.0110.01015.05
7.0.80.0230.00815.12
7.0.70.0080.01215.11
7.0.60.0510.00914.92
7.0.50.0590.00414.94
7.0.40.0720.00514.99
7.0.30.0600.00614.90
7.0.20.0580.00414.95
7.0.10.0640.00815.05
7.0.00.0300.00814.86
5.6.400.0140.00615.83
5.6.390.0150.00715.79
5.6.380.0150.00415.89
5.6.370.0120.00816.01
5.6.360.0110.01115.80
5.6.350.0170.00315.78
5.6.340.0120.00915.98
5.6.330.0140.00715.79
5.6.320.0070.01215.76
5.6.310.0140.00715.81
5.6.300.0140.00515.83
5.6.290.0160.00315.97
5.6.280.0130.02517.53
5.6.270.0120.00915.82
5.6.260.0100.01015.89
5.6.250.0150.00315.89
5.6.240.0150.00316.07
5.6.230.0120.00615.99
5.6.220.0120.00515.95
5.6.210.0120.02617.45
5.6.200.0180.02517.59
5.6.190.0120.02317.58
5.6.180.0150.02717.61
5.6.170.0130.02917.54
5.6.160.0160.02817.65
5.6.150.0160.02017.59
5.6.140.0070.03017.62
5.6.130.0120.02317.61
5.6.120.0130.02517.61
5.6.110.0130.03417.55
5.6.100.0150.03117.55
5.6.90.0130.03017.51
5.6.80.0130.02217.11
5.6.70.0100.00815.97
5.6.60.0130.00716.06
5.6.50.0150.00615.83
5.6.40.0150.00315.81
5.6.30.0110.00815.81
5.6.20.0120.00615.85
5.6.10.0060.01215.87
5.6.00.0130.00515.87
5.5.380.0120.00516.10
5.5.370.0130.00615.91
5.5.360.0100.00915.71
5.5.350.0110.02216.36
5.5.340.0130.02516.53
5.5.330.0170.01716.49
5.5.320.0150.02016.57
5.5.310.0080.03516.38
5.5.300.0130.02116.54
5.5.290.0170.02016.50
5.5.280.0100.03216.45
5.5.270.0130.02716.52
5.5.260.0140.02216.55
5.5.250.0110.02516.56
5.5.240.0160.02016.39
5.5.230.0130.00515.84
5.5.220.0060.01215.83
5.5.210.0140.00715.91
5.5.200.0140.00515.75
5.5.190.0120.00715.66
5.5.180.0150.00515.83
5.5.170.0140.00415.79
5.5.160.0100.00715.73
5.5.150.0140.00315.73
5.5.140.0110.00815.53
5.5.130.0110.00715.67
5.5.120.0100.00815.67
5.5.110.0150.00315.60
5.5.100.0130.00315.94
5.5.90.0150.00115.93
5.5.80.0090.01115.79
5.5.70.0170.00115.95
5.5.60.0100.00715.77
5.5.50.0100.00715.97
5.5.40.0100.00715.82
5.5.30.0100.00715.77
5.5.20.0080.00915.84
5.5.10.0090.00715.81
5.5.00.0180.00415.76
5.4.450.0080.02314.92
5.4.440.0170.01814.89
5.4.430.0100.02215.04
5.4.420.0110.02514.99
5.4.410.0130.02114.77
5.4.400.0110.02014.79
5.4.390.0110.02414.78
5.4.380.0100.03014.77
5.4.370.0120.02214.83
5.4.360.0080.02614.65
5.4.350.0130.02614.70
5.4.340.0070.02614.89
5.4.330.0070.00912.76
5.4.320.0080.02714.84
5.4.310.0120.01814.75
5.4.300.0070.02814.92
5.4.290.0100.02414.85
5.4.280.0110.02014.79
5.4.270.0120.02314.76
5.4.260.0110.02614.70
5.4.250.0160.01514.87
5.4.240.0100.02014.75
5.4.230.0080.02914.74
5.4.220.0060.02514.66
5.4.210.0120.02614.64
5.4.200.0130.02414.72
5.4.190.0100.01914.71
5.4.180.0140.02014.65
5.4.170.0100.02114.77
5.4.160.0090.02814.59
5.4.150.0050.03314.64
5.4.140.0120.02113.93
5.4.130.0100.01814.02
5.4.120.0130.02214.01
5.4.110.0110.02414.06
5.4.100.0120.01813.96
5.4.90.0090.02314.01
5.4.80.0110.02414.05
5.4.70.0090.02014.22
5.4.60.0090.01913.99
5.4.50.0070.02113.98
5.4.40.0080.02114.01
5.4.30.0090.02414.00
5.4.20.0080.02113.99
5.4.10.0100.02113.99
5.4.00.0080.02913.64
5.3.290.0110.02113.69
5.3.280.0090.02013.54
5.3.270.0110.01813.73
5.3.260.0100.02313.59
5.3.250.0100.01913.67
5.3.240.0090.02113.53
5.3.230.0100.01913.67
5.3.220.0070.02313.40
5.3.210.0120.01913.44
5.3.200.0060.02813.55
5.3.190.0070.02413.56
5.3.180.0080.02113.63
5.3.170.0110.02613.52
5.3.160.0100.02613.72
5.3.150.0070.02513.57
5.3.140.0080.02913.61
5.3.130.0110.01913.62
5.3.120.0100.02013.61
5.3.110.0090.02313.60
5.3.100.0120.02313.39
5.3.90.0070.02013.54
5.3.80.0090.02113.43
5.3.70.0090.01913.35
5.3.60.0070.02113.36
5.3.50.0100.01713.33
5.3.40.0120.02313.32
5.3.30.0120.01613.31
5.3.20.0110.02113.28
5.3.10.0080.02313.22
5.3.00.0100.02513.03

preferences:
54.51 ms | 403 KiB | 5 Q