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 FluentCounter implements Counter { private $count = 0; public function count() { $this->count += 1; return $this; } public function getCount() { return $this->count; } } $counter = new EchoingCounter(new FluentCounter()); $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.0090.00016.78
8.3.120.0090.00020.73
8.3.110.0030.00618.31
8.3.100.0070.00424.06
8.3.90.0050.00326.77
8.3.80.0030.00616.61
8.3.70.0090.00616.75
8.3.60.0100.01018.56
8.3.50.0090.00821.14
8.3.40.0130.00918.83
8.3.30.0110.00620.34
8.3.20.0080.00018.95
8.3.10.0050.00321.10
8.3.00.0050.00223.71
8.2.250.0120.00316.50
8.2.240.0000.00817.37
8.2.230.0040.00420.94
8.2.220.0080.00837.54
8.2.210.0050.00326.77
8.2.200.0060.00318.54
8.2.190.0090.00618.48
8.2.180.0120.00925.92
8.2.170.0110.01118.96
8.2.160.0140.00022.96
8.2.150.0060.00325.66
8.2.140.0040.00424.66
8.2.130.0080.00626.16
8.2.120.0060.00321.00
8.2.110.0060.00319.38
8.2.100.0080.00417.72
8.2.90.0060.00318.09
8.2.80.0040.00419.35
8.2.70.0050.00317.93
8.2.60.0000.00818.22
8.2.50.0080.00018.10
8.2.40.0030.00718.29
8.2.30.0000.00818.11
8.2.20.0040.00417.79
8.2.10.0040.00417.73
8.2.00.0070.00017.80
8.1.300.0040.00418.46
8.1.290.0060.00330.84
8.1.280.0090.00625.92
8.1.270.0030.00623.99
8.1.260.0060.00326.35
8.1.250.0060.00328.09
8.1.240.0000.00922.74
8.1.230.0090.00322.50
8.1.220.0080.00017.74
8.1.210.0040.00418.87
8.1.200.0040.00817.25
8.1.190.0040.00417.35
8.1.180.0060.00318.10
8.1.170.0070.00018.75
8.1.160.0040.00418.90
8.1.150.0050.00218.64
8.1.140.0040.00417.37
8.1.130.0060.00218.38
8.1.120.0080.00118.31
8.1.110.0020.00618.31
8.1.100.0020.00618.37
8.1.90.0030.00518.35
8.1.80.0030.00418.37
8.1.70.0040.00418.38
8.1.60.0040.00518.39
8.1.50.0030.00518.32
8.1.40.0030.00518.51
8.1.30.0020.00618.45
8.1.20.0030.00518.53
8.1.10.0010.00618.47
8.1.00.0050.00418.41
8.0.300.0000.00719.85
8.0.290.0000.00716.75
8.0.280.0070.00018.46
8.0.270.0050.00216.88
8.0.260.0030.00417.74
8.0.250.0060.00217.81
8.0.240.0050.00317.77
8.0.230.0040.00517.81
8.0.220.0060.00117.19
8.0.210.0040.00417.20
8.0.200.0000.00917.87
8.0.190.0010.00617.90
8.0.180.0000.00817.79
8.0.170.0010.00717.81
8.0.160.0060.00217.17
8.0.150.0050.00317.80
8.0.140.0030.00517.82
8.0.130.0030.00415.38
8.0.120.0020.00617.75
8.0.110.0040.00417.08
8.0.100.0030.00517.85
8.0.90.0030.00617.73
8.0.80.0030.00817.86
8.0.70.0010.00717.81
8.0.60.0000.00817.78
8.0.50.0070.00217.83
8.0.30.0070.00817.62
8.0.20.0110.00617.81
8.0.10.0030.00617.12
8.0.00.0110.00917.02
7.4.330.0080.00416.16
7.4.320.0200.00216.99
7.4.300.0140.00216.91
7.4.290.0080.00616.94
7.4.280.0050.00717.01
7.4.270.0110.00216.99
7.4.260.0070.00616.98
7.4.250.0080.00516.93
7.4.240.0080.00416.88
7.4.230.0090.00616.99
7.4.220.0070.01116.92
7.4.210.0140.00316.96
7.4.200.0080.00516.88
7.4.190.0090.00417.05
7.4.180.0120.00617.37
7.4.160.0120.00516.81
7.4.150.0130.00617.39
7.4.140.0100.00817.69
7.4.130.0090.00916.82
7.4.120.0120.00516.78
7.4.110.0090.01216.99
7.4.100.0110.00816.97
7.4.90.0100.00816.86
7.4.80.0130.00818.38
7.4.70.0090.00916.87
7.4.60.0130.00516.78
7.4.50.0080.00716.59
7.4.40.0070.00718.83
7.4.30.0090.00716.95
7.4.20.0090.00616.79
7.4.10.0090.00916.84
7.4.00.0090.00715.86
7.3.330.0040.00715.27
7.3.320.0070.00315.21
7.3.310.0110.00316.81
7.3.300.0120.00216.80
7.3.290.0050.00716.81
7.3.280.0120.00416.54
7.3.270.0130.00317.39
7.3.260.0110.00818.02
7.3.250.0150.00216.78
7.3.240.0070.00816.96
7.3.230.0080.00916.89
7.3.220.0090.00717.37
7.3.210.0100.00916.99
7.3.200.0070.00818.38
7.3.190.0160.00316.92
7.3.180.0110.00516.68
7.3.170.0060.00916.93
7.3.160.0090.00616.78
7.3.150.0100.00816.89
7.3.140.0070.00916.73
7.3.130.0120.00416.79
7.3.120.0090.00715.80
7.3.110.0070.00916.12
7.3.100.0080.00816.12
7.3.90.0090.00716.16
7.3.80.0080.00816.13
7.3.70.0070.00616.13
7.3.60.0080.00716.13
7.3.50.0070.00916.05
7.3.40.0100.00815.97
7.3.30.0090.00616.10
7.3.20.0250.00716.35
7.3.10.0270.00716.37
7.3.00.0180.00816.38
7.2.340.0070.00717.37
7.2.330.0120.00417.08
7.2.320.0110.00816.97
7.2.310.0050.01216.88
7.2.300.0080.00817.02
7.2.290.0090.00917.10
7.2.280.0110.00516.84
7.2.270.0080.00917.03
7.2.260.0100.00616.97
7.2.250.0110.00616.35
7.2.240.0050.01116.23
7.2.230.0100.00616.23
7.2.220.0090.00816.46
7.2.210.0090.00716.33
7.2.200.0150.00216.34
7.2.190.0110.00516.29
7.2.180.0090.00916.18
7.2.170.0080.00816.31
7.2.160.0110.00416.98
7.2.150.0340.00816.68
7.2.140.0320.00616.63
7.2.130.0270.00616.72
7.2.120.0490.00616.73
7.2.110.0310.00616.67
7.2.100.0270.00616.59
7.2.90.0260.01116.66
7.2.80.0280.00916.62
7.2.70.0320.00816.66
7.2.60.0330.00716.58
7.2.50.0340.00516.75
7.2.40.0280.00816.67
7.2.30.0300.00616.56
7.2.20.0260.00616.66
7.2.10.0360.00316.70
7.2.00.0370.00716.67
7.1.330.0130.00516.26
7.1.320.0160.00216.30
7.1.310.0090.00816.33
7.1.300.0110.00816.09
7.1.290.0110.00916.09
7.1.280.0140.00616.20
7.1.270.0090.01016.19
7.1.260.0120.00516.18
7.1.250.0290.00615.63
7.1.240.0440.00815.59
7.1.230.0370.01215.56
7.1.220.0340.01015.57
7.1.210.0330.00515.52
7.1.200.0250.00715.65
7.1.190.0300.00615.61
7.1.180.0360.00715.61
7.1.170.0380.00715.54
7.1.160.0380.00915.58
7.1.150.0390.00515.66
7.1.140.0330.00815.66
7.1.130.0350.00415.59
7.1.120.0430.00715.54
7.1.110.0330.00515.71
7.1.100.0350.00515.66
7.1.90.0360.00415.52
7.1.80.0330.00615.58
7.1.70.0270.00716.05
7.1.60.0260.00716.10
7.1.50.0270.00916.06
7.1.40.0190.00616.06
7.1.30.0260.00615.98
7.1.20.0330.00816.09
7.1.10.0240.00816.03
7.1.00.0210.00916.04
7.0.330.0430.00515.20
7.0.320.0360.00715.36
7.0.310.0240.01215.41
7.0.300.0440.00215.33
7.0.290.0320.00915.35
7.0.280.0390.00715.33
7.0.270.0360.00515.37
7.0.260.0290.00515.36
7.0.250.0260.00815.28
7.0.240.0310.00315.44
7.0.230.0260.01115.33
7.0.220.0250.01115.35
7.0.210.0300.00515.27
7.0.200.0190.01015.85
7.0.190.0260.00715.92
7.0.180.0270.00615.89
7.0.170.0240.00715.83
7.0.160.0200.00615.89
7.0.150.0230.00715.87
7.0.140.0270.00615.93
7.0.130.0240.00215.80
7.0.120.0210.00515.96
7.0.110.0260.00615.77
7.0.100.0210.00915.83
7.0.90.0530.00515.79
7.0.80.0310.00615.75
7.0.70.0280.00715.83
7.0.60.0210.00915.79
7.0.50.0350.00515.91
7.0.40.0270.01015.78
7.0.30.0350.00515.85
7.0.20.0230.00815.84
7.0.10.0230.00915.84
7.0.00.0210.00715.83
5.6.400.0130.00816.80
5.6.390.0150.00816.64
5.6.380.0150.00715.87
5.6.370.0110.00816.00
5.6.360.0100.01115.82
5.6.350.0140.00515.79
5.6.340.0120.00815.91
5.6.330.0140.00815.84
5.6.320.0130.01015.77
5.6.310.0130.00515.94
5.6.300.0080.02017.15
5.6.290.0120.01817.07
5.6.280.0110.01717.20
5.6.270.0060.02117.19
5.6.260.0120.01717.15
5.6.250.0130.01517.10
5.6.240.0120.02817.13
5.6.230.0110.01717.07
5.6.220.0130.02817.08
5.6.210.0140.01617.12
5.6.200.0080.03017.06
5.6.190.0110.02817.10
5.6.180.0120.01717.08
5.6.170.0130.02517.08
5.6.160.0100.02117.06
5.6.150.0120.01917.13
5.6.140.0120.02117.08
5.6.130.0100.01817.11
5.6.120.0150.02417.23
5.6.110.0140.01417.08
5.6.100.0150.02617.09
5.6.90.0110.01817.13
5.6.80.0110.01916.93
5.6.70.0120.01716.86
5.6.60.0080.01916.90
5.6.50.0120.01316.96
5.6.40.0100.02416.91
5.6.30.0110.01616.98
5.6.20.0090.01917.02
5.6.10.0080.01716.96
5.6.00.0110.01616.80
5.5.380.0100.01515.53
5.5.370.0130.01615.47
5.5.360.0120.01415.52
5.5.350.0110.01715.55
5.5.340.0100.02515.58
5.5.330.0100.01815.62
5.5.320.0160.02315.71
5.5.310.0100.01915.57
5.5.300.0130.01315.59
5.5.290.0120.02015.71
5.5.280.0120.01715.67
5.5.270.0110.02815.68
5.5.260.0140.02515.72
5.5.250.0100.02415.57
5.5.240.0120.01415.50
5.5.230.0130.01115.50
5.5.220.0100.01415.46
5.5.210.0090.01515.41
5.5.200.0090.01515.56
5.5.190.0110.01515.39
5.5.180.0120.01415.40
5.5.170.0180.00214.75
5.5.160.0090.02015.41
5.5.150.0130.01215.53
5.5.140.0120.02015.38
5.5.130.0090.01815.48
5.5.120.0110.01615.56
5.5.110.0100.02515.39
5.5.100.0060.01815.39
5.5.90.0150.01115.53
5.5.80.0110.01315.48
5.5.70.0090.01715.43
5.5.60.0130.02015.48
5.5.50.0120.02315.44
5.5.40.0100.01915.49
5.5.30.0120.01415.44
5.5.20.0110.01315.41
5.5.10.0130.01415.43
5.5.00.0080.01615.34
5.4.450.0090.02315.15
5.4.440.0080.02015.28
5.4.430.0100.01615.23
5.4.420.0110.02215.12
5.4.410.0100.01615.09
5.4.400.0080.01714.99
5.4.390.0080.01715.13
5.4.380.0080.01415.08
5.4.370.0080.01515.06
5.4.360.0080.01915.03
5.4.350.0090.01915.00
5.4.340.0120.01415.03
5.4.330.0160.00313.71
5.4.320.0080.01615.08
5.4.310.0090.01415.22
5.4.300.0110.01215.07
5.4.290.0060.01715.07
5.4.280.0100.01915.11
5.4.270.0080.02215.11
5.4.260.0100.01515.04
5.4.250.0090.01415.02
5.4.240.0100.01615.07
5.4.230.0110.01515.00
5.4.220.0110.01214.98
5.4.210.0110.01915.14
5.4.200.0100.01515.12
5.4.190.0100.01315.04
5.4.180.0110.01415.10
5.4.170.0100.01115.03
5.4.160.0110.01215.08
5.4.150.0100.01315.07
5.4.140.0100.01314.74
5.4.130.0080.01414.70
5.4.120.0080.01514.74
5.4.110.0080.01314.69
5.4.100.0080.01514.72
5.4.90.0120.02114.70
5.4.80.0070.01514.55
5.4.70.0100.01814.66
5.4.60.0080.01314.67
5.4.50.0100.01814.68
5.4.40.0110.01214.71
5.4.30.0080.01414.66
5.4.20.0090.01314.71
5.4.10.0060.01414.69
5.4.00.0100.01214.69
5.3.290.0090.01514.67
5.3.280.0070.01814.57
5.3.270.0070.01614.62
5.3.260.0100.01314.70
5.3.250.0090.01614.61
5.3.240.0050.01814.60
5.3.230.0100.01214.58
5.3.220.0110.01114.56
5.3.210.0100.01214.56
5.3.200.0090.01614.56
5.3.190.0130.01514.59
5.3.180.0090.02314.68
5.3.170.0070.01514.65
5.3.160.0090.01414.60
5.3.150.0100.01414.66
5.3.140.0090.01414.59
5.3.130.0090.01514.57
5.3.120.0100.01414.59
5.3.110.0080.02014.62
5.3.100.0070.01514.64
5.3.90.0100.02214.58
5.3.80.0080.02314.52
5.3.70.0100.01414.60
5.3.60.0100.01414.67
5.3.50.0120.01214.52
5.3.40.0110.01414.56
5.3.30.0100.01314.60
5.3.20.0070.01514.55
5.3.10.0070.01514.55
5.3.00.0100.01514.47

preferences:
30.73 ms | 403 KiB | 5 Q