3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Counter { /** @return self */ public function count(); /** @return int */ public function 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 ImmutableCounter(); $counter = $counter->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.0060.00318.29
8.3.120.0030.00618.82
8.3.110.0070.00420.94
8.3.100.0100.00018.50
8.3.90.0080.01226.77
8.3.80.0040.00716.63
8.3.70.0090.00918.14
8.3.60.0070.00716.38
8.3.50.0070.01221.97
8.3.40.0110.00418.72
8.3.30.0200.00019.09
8.3.20.0040.00420.34
8.3.10.0040.00423.53
8.3.00.0000.00820.80
8.2.250.0060.00316.50
8.2.240.0130.00318.75
8.2.230.0000.00822.58
8.2.220.0130.00724.06
8.2.210.0000.00826.77
8.2.200.0050.00516.50
8.2.190.0060.00918.54
8.2.180.0110.00425.92
8.2.170.0110.00422.96
8.2.160.0000.01320.52
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0030.00526.16
8.2.120.0090.00319.56
8.2.110.0040.00719.21
8.2.100.0070.00417.91
8.2.90.0000.00819.22
8.2.80.0050.00317.97
8.2.70.0030.00717.38
8.2.60.0000.00817.80
8.2.50.0040.00417.63
8.2.40.0030.00519.78
8.2.30.0050.00318.29
8.2.20.0040.00417.56
8.2.10.0000.00717.92
8.2.00.0040.00417.68
8.1.300.0120.00317.85
8.1.290.0040.00430.84
8.1.280.0160.00025.92
8.1.270.0040.00423.99
8.1.260.0050.00326.35
8.1.250.0070.00028.09
8.1.240.0090.00019.16
8.1.230.0090.00317.71
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0060.00317.34
8.1.190.0040.00417.35
8.1.180.0030.00518.10
8.1.170.0050.00317.62
8.1.160.0040.00421.89
8.1.150.0000.00818.64
8.1.140.0040.00417.46
8.1.130.0000.00717.37
8.1.120.0060.00718.06
8.1.110.0090.00418.05
8.1.100.0070.00518.10
8.1.90.0060.00618.03
8.1.80.0040.00918.03
8.1.70.0090.00418.91
8.1.60.0100.00518.18
8.1.50.0060.00718.15
8.1.40.0090.00518.17
8.1.30.0040.01118.20
8.1.20.0050.01018.25
8.1.10.0110.00318.13
8.1.00.0080.00518.07
8.0.300.0070.00018.77
8.0.290.0020.00516.63
8.0.280.0080.00018.44
8.0.270.0050.00317.88
8.0.260.0000.00716.80
8.0.250.0040.00817.47
8.0.240.0090.00317.41
8.0.230.0090.00317.45
8.0.220.0110.00217.36
8.0.210.0030.00817.42
8.0.200.0090.00217.52
8.0.190.0110.00217.50
8.0.180.0050.00717.43
8.0.170.0110.00217.54
8.0.160.0060.00517.46
8.0.150.0050.00617.34
8.0.140.0100.00417.32
8.0.130.0060.00515.66
8.0.120.0080.00317.38
8.0.110.0050.00517.40
8.0.100.0080.00217.14
8.0.90.0070.00417.20
8.0.80.0050.00717.27
8.0.70.0070.00217.20
8.0.60.0040.00617.28
8.0.50.0030.00817.31
8.0.30.0070.00817.20
8.0.20.0090.00817.31
8.0.10.0130.00317.34
8.0.00.0080.00617.09
7.4.330.0050.00415.34
7.4.320.0080.00517.11
7.4.300.0040.00417.01
7.4.290.0040.00817.02
7.4.280.0100.00217.06
7.4.270.0080.00417.04
7.4.260.0070.00517.08
7.4.250.0050.00717.00
7.4.240.0050.00416.91
7.4.230.0010.00716.88
7.4.220.0070.00416.92
7.4.210.0070.00716.78
7.4.200.0050.00416.85
7.4.190.0030.00516.83
7.4.180.0050.00416.95
7.4.160.0060.00616.84
7.4.150.0070.00617.00
7.4.140.0070.00717.19
7.4.130.0090.00516.69
7.4.120.0080.00816.76
7.4.110.0090.00616.67
7.4.100.0090.00716.73
7.4.90.0090.00416.72
7.4.80.0070.00617.47
7.4.70.0050.00716.73
7.4.60.0050.00916.76
7.4.50.0040.00516.69
7.4.40.0050.00716.67
7.4.30.0080.00516.66
7.4.20.0080.00316.81
7.4.10.0060.00516.79
7.4.00.0040.00916.09
7.3.330.0080.00315.27
7.3.320.0070.00315.21
7.3.310.0060.00516.90
7.3.300.0030.00716.67
7.3.290.0090.00416.65
7.3.280.0050.01016.49
7.3.270.0090.00616.80
7.3.260.0100.00416.58
7.3.250.0100.00616.56
7.3.240.0110.00416.57
7.3.230.0070.00816.59
7.3.220.0070.00516.50
7.3.210.0090.00416.50
7.3.200.0130.00317.28
7.3.190.0110.00316.47
7.3.180.0070.00816.51
7.3.170.0080.00616.45
7.3.160.0060.00716.56
7.3.150.0070.00616.63
7.3.140.0050.00716.52
7.3.130.0040.00816.57
7.3.120.0070.00715.93
7.3.110.0100.00516.08
7.3.100.0070.00716.05
7.3.90.0110.00416.28
7.3.80.0080.00616.14
7.3.70.0070.00716.26
7.3.60.0070.00816.38
7.3.50.0070.00516.29
7.3.40.0070.00716.32
7.3.30.0060.00716.39
7.3.20.0080.00517.64
7.3.10.0060.00817.63
7.3.00.0070.00617.68
7.2.340.0140.00516.72
7.2.330.0100.00816.71
7.2.320.0140.00416.76
7.2.310.0070.01116.77
7.2.300.0090.00816.73
7.2.290.0090.00816.74
7.2.280.0090.00816.78
7.2.270.0160.00116.76
7.2.260.0110.00716.78
7.2.250.0110.00716.31
7.2.240.0090.00816.26
7.2.230.0130.00616.31
7.2.220.0110.00616.30
7.2.210.0120.00516.43
7.2.200.0120.00616.60
7.2.190.0120.00516.45
7.2.180.0080.00816.42
7.2.170.0110.00816.43
7.2.160.0120.00616.95
7.2.150.0140.00518.24
7.2.140.0090.01118.21
7.2.130.0120.00518.26
7.2.120.0130.00617.42
7.2.110.0150.00417.36
7.2.100.0370.00716.76
7.2.90.0330.01016.76
7.2.80.0350.00716.83
7.2.70.0420.00516.96
7.2.60.0270.00816.97
7.2.50.0360.00616.92
7.2.40.0340.00716.84
7.2.30.0350.00916.99
7.2.20.0340.00716.88
7.2.10.0380.00816.90
7.2.00.0330.00817.35
7.1.330.0090.00716.61
7.1.320.0110.00616.73
7.1.310.0100.00616.69
7.1.300.0090.00716.70
7.1.290.0110.00616.73
7.1.280.0130.00316.67
7.1.270.0120.00716.68
7.1.260.0070.00916.67
7.1.250.0110.00516.84
7.1.240.0160.00816.13
7.1.230.0150.00616.10
7.1.220.0360.00715.76
7.1.210.0470.00415.70
7.1.200.0300.00815.65
7.1.190.0330.00815.66
7.1.180.0310.00615.69
7.1.170.0360.00415.63
7.1.160.0340.00515.61
7.1.150.0280.00715.54
7.1.140.0390.00415.57
7.1.130.0300.00615.68
7.1.120.0300.00515.66
7.1.110.0320.00415.72
7.1.100.0290.00615.97
7.1.90.0260.00715.66
7.1.80.0270.00415.64
7.1.70.0220.00715.94
7.1.60.0240.00919.39
7.1.50.0310.00818.90
7.1.40.0300.00719.31
7.1.30.0290.00519.23
7.1.20.0300.00519.10
7.1.10.0230.00615.70
7.1.00.0210.01816.83
7.0.330.0080.00916.80
7.0.320.0290.00415.91
7.0.310.0350.00515.39
7.0.300.0320.00715.43
7.0.290.0280.00915.46
7.0.280.0330.00615.29
7.0.270.0290.00615.41
7.0.260.0320.00615.47
7.0.250.0290.00715.55
7.0.240.0300.00915.56
7.0.230.0230.00815.63
7.0.220.0300.00715.46
7.0.210.0280.00415.46
7.0.200.0190.00515.70
7.0.190.0250.00815.52
7.0.180.0270.00715.57
7.0.170.0280.00515.60
7.0.160.0220.00715.40
7.0.150.0240.00715.45
7.0.140.0200.01616.58
7.0.130.0210.01115.44
7.0.120.0240.01616.59
7.0.110.0290.00515.48
7.0.100.0910.00815.40
7.0.90.0250.00615.43
7.0.80.0240.00615.47
7.0.70.0300.00515.41
7.0.60.0210.01416.25
7.0.50.0220.01415.89
7.0.40.0210.01816.38
7.0.30.0290.01416.23
7.0.20.0270.01716.26
7.0.10.0280.01616.20
7.0.00.0260.01716.25
5.6.400.0110.00416.31
5.6.390.0060.01016.26
5.6.380.0100.00715.41
5.6.370.0080.01015.43
5.6.360.0110.00815.49
5.6.350.0130.00615.55
5.6.340.0140.00515.52
5.6.330.0120.00715.46
5.6.320.0120.00715.37
5.6.310.0100.00615.52
5.6.300.0110.00615.41
5.6.290.0110.00615.56
5.6.280.0120.01616.52
5.6.270.0130.00515.51
5.6.260.0120.00715.46
5.6.250.0110.00815.50
5.6.240.0120.00715.52
5.6.230.0120.00715.53
5.6.220.0140.00515.52
5.6.210.0130.01716.40
5.6.200.0100.01916.02
5.6.190.0120.01316.37
5.6.180.0160.01216.38
5.6.170.0140.01616.39
5.6.160.0100.01916.40
5.6.150.0120.01316.08
5.6.140.0120.01416.09
5.6.130.0090.01615.97
5.6.120.0090.01716.44
5.6.110.0130.01116.43
5.6.100.0130.01816.42
5.6.90.0090.01716.37
5.6.80.0120.01916.27
5.6.70.0140.00715.49
5.6.60.0090.01015.54
5.6.50.0090.01015.36
5.6.40.0110.00715.45
5.6.30.0090.01015.47
5.6.20.0090.00915.52
5.6.10.0130.00615.39
5.6.00.0130.00615.46
5.5.380.0090.00614.32
5.5.370.0120.00314.25
5.5.360.0110.00514.27
5.5.350.0140.01115.22
5.5.340.0100.01714.84
5.5.330.0110.01815.24
5.5.320.0160.01015.30
5.5.310.0110.01315.25
5.5.300.0110.01514.85
5.5.290.0090.02014.76
5.5.280.0110.01815.24
5.5.270.0080.01415.32
5.5.260.0140.01315.25
5.5.250.0090.01615.39
5.5.240.0100.01715.33
5.5.230.0110.00514.32
5.5.220.0130.00314.23
5.5.210.0090.00614.26
5.5.200.0070.00814.24
5.5.190.0100.00614.17
5.5.180.0110.00614.13
5.5.170.0130.00815.32
5.5.160.0090.00714.23
5.5.150.0100.00614.16
5.5.140.0130.00414.02
5.5.130.0110.00714.04
5.5.120.0100.00614.09
5.5.110.0140.00214.08
5.5.100.0120.00314.20
5.5.90.0110.00614.28
5.5.80.0080.00714.23
5.5.70.0090.00714.25
5.5.60.0120.00414.26
5.5.50.0120.00514.28
5.5.40.0060.00814.17
5.5.30.0120.00414.22
5.5.20.0100.00614.25
5.5.10.0080.00814.24
5.5.00.0110.00514.24
5.4.450.0120.01213.77
5.4.440.0120.01413.74
5.4.430.0080.01113.74
5.4.420.0070.01413.77
5.4.410.0080.01213.79
5.4.400.0090.01113.69
5.4.390.0100.01613.80
5.4.380.0100.01413.77
5.4.370.0090.01713.64
5.4.360.0100.01513.74
5.4.350.0100.01513.71
5.4.340.0100.00913.68
5.4.330.0110.00412.69
5.4.320.0090.01613.66
5.4.310.0100.01013.76
5.4.300.0090.00913.67
5.4.290.0110.01413.81
5.4.280.0070.01813.63
5.4.270.0070.01913.75
5.4.260.0080.01613.74
5.4.250.0070.01813.75
5.4.240.0090.01513.71
5.4.230.0090.01713.58
5.4.220.0080.01313.64
5.4.210.0100.01613.67
5.4.200.0070.01513.57
5.4.190.0090.01313.64
5.4.180.0090.01913.63
5.4.170.0080.01113.61
5.4.160.0080.00913.71
5.4.150.0100.00913.68
5.4.140.0070.01313.24
5.4.130.0070.01213.29
5.4.120.0080.01513.32
5.4.110.0070.01913.34
5.4.100.0080.01613.22
5.4.90.0070.01413.22
5.4.80.0080.01113.33
5.4.70.0050.01313.31
5.4.60.0100.01513.28
5.4.50.0090.01213.15
5.4.40.0090.01013.27
5.4.30.0060.01113.33
5.4.20.0060.01213.34
5.4.10.0090.01213.31
5.4.00.0060.01313.18
5.3.290.0090.01513.05
5.3.280.0100.01712.97
5.3.270.0120.01313.00
5.3.260.0080.01512.86
5.3.250.0100.01612.95
5.3.240.0100.01512.88
5.3.230.0090.01612.80
5.3.220.0070.01012.77
5.3.210.0050.01212.79
5.3.200.0060.01812.74
5.3.190.0080.01512.79
5.3.180.0080.01712.91
5.3.170.0070.01112.96
5.3.160.0070.01112.89
5.3.150.0060.01612.97
5.3.140.0110.01412.86
5.3.130.0080.01212.85
5.3.120.0090.01512.85
5.3.110.0090.01412.83
5.3.100.0050.01412.77
5.3.90.0090.01112.78
5.3.80.0080.01612.71
5.3.70.0070.01312.71
5.3.60.0080.01212.74
5.3.50.0080.01112.69
5.3.40.0060.01512.69
5.3.30.0070.01212.72
5.3.20.0080.01512.73
5.3.10.0080.01512.58
5.3.00.0090.01512.54

preferences:
64.52 ms | 403 KiB | 5 Q