3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Counter { /** @return self */ public function count(); /** @return int */ public function getCount(); } class FluentCounter implements Counter { private $count = 0; public function count() { $this->count += 1; return $this; } public function getCount() { return $this->count; } } $counter = new FluentCounter(); $counter = $counter->count()->count()->count(); $new_count = $counter->count()->count()->count(); echo $counter->getCount(); echo "\n"; echo $new_count->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.60.0120.00616.63
8.3.50.0140.00522.12
8.3.40.0040.01118.90
8.3.30.0070.00719.05
8.3.20.0040.00420.33
8.3.10.0040.00421.85
8.3.00.0080.00019.07
8.2.180.0110.00716.63
8.2.170.0140.00718.99
8.2.160.0070.00722.96
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00819.79
8.2.110.0060.00320.23
8.2.100.0070.00418.03
8.2.90.0100.00019.40
8.2.80.0090.00017.97
8.2.70.0040.00417.61
8.2.60.0040.00417.93
8.2.50.0040.00418.07
8.2.40.0000.00818.34
8.2.30.0070.00019.32
8.2.20.0000.00817.61
8.2.10.0040.00418.09
8.2.00.0060.00317.65
8.1.280.0170.00025.92
8.1.270.0080.00818.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0060.00324.02
8.1.230.0060.00619.02
8.1.220.0060.00317.77
8.1.210.0000.00918.77
8.1.200.0030.00617.22
8.1.190.0030.00517.23
8.1.180.0050.00318.10
8.1.170.0060.00318.64
8.1.160.0050.00222.07
8.1.150.0070.00018.85
8.1.140.0040.00419.29
8.1.130.0070.00017.69
8.1.120.0000.00717.36
8.1.110.0030.00517.31
8.1.100.0030.00617.32
8.1.90.0040.00417.37
8.1.80.0000.00717.29
8.1.70.0030.00317.36
8.1.60.0040.00417.56
8.1.50.0080.00017.50
8.1.40.0110.00017.41
8.1.30.0030.00617.67
8.1.20.0000.00717.50
8.1.10.0040.00417.53
8.1.00.0070.00017.52
8.0.300.0070.00018.77
8.0.290.0070.00016.75
8.0.280.0000.00718.47
8.0.270.0030.00317.25
8.0.260.0030.00317.12
8.0.250.0000.00716.81
8.0.240.0000.00616.93
8.0.230.0000.00816.91
8.0.220.0000.00616.73
8.0.210.0030.00616.88
8.0.200.0000.00616.97
8.0.190.0040.00416.88
8.0.180.0000.00716.86
8.0.170.0040.00416.78
8.0.160.0050.00216.85
8.0.150.0080.00016.90
8.0.140.0020.00516.76
8.0.130.0060.00013.32
8.0.120.0030.00516.88
8.0.110.0000.00716.79
8.0.100.0040.00416.95
8.0.90.0000.00716.72
8.0.80.0090.01316.77
8.0.70.0000.00816.66
8.0.60.0070.00016.71
8.0.50.0000.00716.88
8.0.30.0140.01216.96
8.0.20.0100.01317.40
8.0.10.0000.00717.01
8.0.00.0070.01116.81
7.4.330.0000.00615.03
7.4.320.0000.00616.45
7.4.300.0060.00016.55
7.4.290.0000.00716.55
7.4.280.0030.00616.58
7.4.270.0030.00516.43
7.4.260.0070.00016.48
7.4.250.0040.00416.32
7.4.240.0030.00316.52
7.4.230.0070.00016.62
7.4.220.0090.00916.61
7.4.210.0130.00716.62
7.4.200.0000.00716.39
7.4.160.0060.00916.27
7.4.150.0130.00617.40
7.4.140.0080.01017.86
7.4.130.0130.00516.47
7.4.120.0060.01116.43
7.4.110.0130.00616.47
7.4.100.0150.00616.46
7.4.90.0110.00616.63
7.4.80.0110.00719.39
7.4.70.0120.00316.57
7.4.60.0090.00616.54
7.4.50.0050.00316.44
7.4.40.0080.00816.54
7.4.30.0150.00716.56
7.4.00.0080.00915.02
7.3.330.0020.00213.24
7.3.320.0050.00013.11
7.3.310.0000.00716.36
7.3.300.0000.00716.29
7.3.290.0030.00316.12
7.3.280.0050.00916.24
7.3.270.0130.00317.40
7.3.260.0060.01816.46
7.3.250.0120.01016.38
7.3.240.0150.00616.38
7.3.230.0100.00716.46
7.3.210.0000.01716.46
7.3.200.0120.00919.39
7.3.190.0060.00916.55
7.3.180.0090.00616.57
7.3.170.0130.00916.38
7.3.160.0100.01016.59
7.3.120.0040.01214.61
7.3.110.0090.00914.74
7.3.100.0040.01114.79
7.3.90.0070.01014.79
7.3.80.0000.01714.56
7.3.70.0060.00614.44
7.3.60.0080.00814.71
7.3.50.0090.00614.82
7.3.40.0060.00314.72
7.3.30.0110.00414.73
7.3.20.0060.00616.51
7.3.10.0080.00816.50
7.3.00.0060.00616.50
7.2.330.0110.01116.87
7.2.320.0110.00716.70
7.2.310.0100.00716.73
7.2.300.0190.02716.79
7.2.290.0070.01116.55
7.2.250.0060.01214.87
7.2.240.0120.00814.80
7.2.230.0100.00714.98
7.2.220.0000.01014.63
7.2.210.0060.00915.00
7.2.200.0060.00614.83
7.2.190.0060.01014.95
7.2.180.0070.00314.75
7.2.170.0030.01315.01
7.2.60.0000.01316.65
7.2.00.0030.01019.54
7.1.330.0100.00315.95
7.1.320.0100.00315.73
7.1.310.0100.00315.88
7.1.300.0030.00615.63
7.1.290.0100.00315.78
7.1.280.0060.00915.79
7.1.270.0070.00715.82
7.1.260.0090.00615.59
7.1.200.0080.00815.84
7.1.100.0090.02216.18
7.1.70.0000.00917.18
7.1.60.0030.00719.46
7.1.50.0070.01816.92
7.1.00.0030.07722.54
7.0.200.0170.01016.36
7.0.140.0100.04722.05
7.0.60.0000.07719.93
7.0.50.0030.04317.96
7.0.40.0000.08320.40
7.0.30.0330.05720.08
7.0.20.0270.05720.27
7.0.10.0000.06020.19
7.0.00.0070.04720.20
5.6.280.0070.07021.16
5.6.210.0030.08020.67
5.6.200.0100.07318.16
5.6.190.0000.08020.63
5.6.180.0330.07320.34
5.6.170.0170.04720.50
5.6.160.0070.08020.54
5.6.150.0100.07318.15
5.6.140.0100.04718.17
5.6.130.0070.08018.20
5.6.120.0130.08021.15
5.6.110.0130.05020.98
5.6.100.0070.04020.99
5.6.90.0070.08320.97
5.6.80.0070.07320.43
5.5.350.0230.07720.39
5.5.340.0130.07318.02
5.5.330.0130.08020.25
5.5.320.0030.08020.35
5.5.310.0270.07020.29
5.5.300.0000.04017.95
5.5.290.0030.07318.05
5.5.280.0100.08320.88
5.5.270.0100.08320.73
5.5.260.0100.04720.87
5.5.250.0070.08320.47
5.5.240.0030.07020.26
5.4.450.0330.07319.48
5.4.440.0170.05719.60
5.4.430.0200.05019.69
5.4.420.0130.05719.60
5.4.410.0200.05719.42
5.4.400.0130.06319.37
5.4.390.0170.06018.49
5.4.380.0200.05318.79
5.4.370.0170.06018.54
5.4.360.0270.06318.50
5.4.350.0130.06018.63
5.4.340.0230.05018.77
5.4.320.0130.07318.58
5.4.310.0270.05018.53
5.4.300.0170.05318.69
5.4.290.0130.05718.54
5.4.280.0230.04718.77
5.4.270.0370.06318.57
5.4.260.0070.06718.81
5.4.250.0230.07318.73
5.4.240.0200.05018.71
5.4.230.0300.06018.61
5.4.220.0230.07018.75
5.4.210.0130.06718.60
5.4.200.0170.05016.79
5.4.190.0200.05718.76
5.4.180.0370.04718.55
5.4.170.0130.07018.71
5.4.160.0230.06718.57
5.4.150.0300.04718.63
5.4.140.0300.04716.46
5.4.130.0200.05016.18
5.4.120.0100.05716.29
5.4.110.0200.05016.21
5.4.100.0070.06016.26
5.4.90.0170.05016.27
5.4.80.0170.05016.27
5.4.70.0270.05316.26
5.4.60.0230.04316.40
5.4.50.0130.05316.21
5.4.40.0170.05316.18
5.4.30.0130.06016.13
5.4.20.0200.05016.40
5.4.10.0130.05316.20
5.4.00.0100.06015.65
5.3.290.0130.06014.91
5.3.280.0200.05014.58
5.3.270.0230.05314.66
5.3.260.0200.05314.66
5.3.250.0170.05014.66
5.3.240.0230.04714.74
5.3.230.0130.05714.74
5.3.220.0130.05714.67
5.3.210.0130.05314.75
5.3.200.0230.04714.75
5.3.190.0170.05314.70
5.3.180.0300.04314.67
5.3.170.0100.06314.57
5.3.160.0230.04714.61
5.3.150.0200.06014.72
5.3.140.0200.05014.61
5.3.130.0200.05014.72
5.3.120.0070.06314.65
5.3.110.0370.04314.68
5.3.100.0230.07014.22
5.3.90.0170.05714.08
5.3.80.0230.04314.07
5.3.70.0330.03714.15
5.3.60.0200.04714.06
5.3.50.0170.05013.98
5.3.40.0130.05313.99
5.3.30.0170.05714.02
5.3.20.0170.05013.70
5.3.10.0270.04013.69
5.3.00.0200.04713.70
5.2.170.0130.04711.21
5.2.160.0130.05711.21
5.2.150.0070.05011.27
5.2.140.0070.05711.28
5.2.130.0130.04011.10
5.2.120.0100.04311.22
5.2.110.0100.05711.13
5.2.100.0130.04311.23
5.2.90.0170.04011.24
5.2.80.0130.04311.21
5.2.70.0100.04711.15
5.2.60.0100.06011.13
5.2.50.0170.04311.09
5.2.40.0130.04310.98
5.2.30.0030.05311.03
5.2.20.0100.04311.16
5.2.10.0130.04310.98
5.2.00.0100.05010.75
5.1.60.0130.03010.11
5.1.50.0030.04710.04
5.1.40.0070.03710.04
5.1.30.0170.03310.43
5.1.20.0170.03310.41
5.1.10.0100.03710.27
5.1.00.0070.04310.06
5.0.50.0130.0238.73
5.0.40.0130.0238.52
5.0.30.0100.0408.27
5.0.20.0100.0238.22
5.0.10.0070.0408.27
5.0.00.0200.0408.17
4.4.90.0070.0305.91
4.4.80.0100.0205.82
4.4.70.0100.0205.81
4.4.60.0030.0275.85
4.4.50.0030.0275.94
4.4.40.0100.0305.90
4.4.30.0030.0235.87
4.4.20.0100.0205.93
4.4.10.0000.0275.96
4.4.00.0030.0405.92
4.3.110.0100.0235.80
4.3.100.0000.0305.81
4.3.90.0100.0235.87
4.3.80.0070.0375.77
4.3.70.0070.0205.78
4.3.60.0070.0205.89
4.3.50.0030.0275.77
4.3.40.0070.0375.77
4.3.30.0030.0234.59
4.3.20.0000.0274.64
4.3.10.0030.0234.49
4.3.00.0070.0279.39

preferences:
47.28 ms | 401 KiB | 5 Q