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 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.60.0070.00716.38
8.3.50.0070.00821.98
8.3.40.0040.01118.81
8.3.30.0090.00619.09
8.3.20.0040.00420.16
8.3.10.0080.00023.66
8.3.00.0030.00519.66
8.2.180.0110.00725.92
8.2.170.0120.00318.91
8.2.160.0070.00722.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00419.77
8.2.110.0040.00420.35
8.2.100.0080.00417.84
8.2.90.0040.00419.34
8.2.80.0050.00317.97
8.2.70.0060.00317.75
8.2.60.0030.00518.16
8.2.50.0000.00918.07
8.2.40.0000.00718.16
8.2.30.0060.00318.33
8.2.20.0000.00717.75
8.2.10.0040.00418.13
8.2.00.0060.00317.70
8.1.280.0160.00625.92
8.1.270.0040.00424.66
8.1.260.0090.00026.35
8.1.250.0050.00328.09
8.1.240.0060.00323.72
8.1.230.0070.00421.04
8.1.220.0000.00817.74
8.1.210.0030.00518.77
8.1.200.0060.00317.38
8.1.190.0040.00417.35
8.1.180.0000.00818.10
8.1.170.0060.00318.27
8.1.160.0000.00821.98
8.1.150.0040.00418.89
8.1.140.0090.00017.46
8.1.130.0000.00717.79
8.1.120.0070.00017.48
8.1.110.0080.00017.46
8.1.100.0070.00017.48
8.1.90.0040.00417.35
8.1.80.0040.00417.39
8.1.70.0050.00617.35
8.1.60.0060.00517.50
8.1.50.0050.00417.45
8.1.40.0090.00417.44
8.1.30.0050.00817.60
8.1.20.0070.00617.56
8.1.10.0100.00417.47
8.1.00.0090.00417.44
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0000.00718.37
8.0.270.0030.00317.28
8.0.260.0030.00317.34
8.0.250.0000.00716.94
8.0.240.0030.00317.03
8.0.230.0000.00717.00
8.0.220.0000.00716.97
8.0.210.0080.00016.87
8.0.200.0040.00416.93
8.0.190.0070.00417.01
8.0.180.0070.00416.96
8.0.170.0070.00416.99
8.0.160.0010.01116.92
8.0.150.0070.00416.93
8.0.140.0070.00516.93
8.0.130.0080.00315.04
8.0.120.0040.00816.90
8.0.110.0070.00516.88
8.0.100.0030.00716.86
8.0.90.0040.00616.86
8.0.80.0080.00716.87
8.0.70.0030.00516.88
8.0.60.0020.00716.90
8.0.50.0060.00416.91
8.0.30.0090.00817.06
8.0.20.0090.00517.16
8.0.10.0060.00417.06
8.0.00.0080.00716.87
7.4.330.0000.00515.14
7.4.320.0060.00016.53
7.4.300.0030.00316.52
7.4.290.0060.00416.51
7.4.280.0060.00516.42
7.4.270.0080.00416.60
7.4.260.0080.00514.89
7.4.250.0060.00716.54
7.4.240.0040.00516.53
7.4.230.0070.00316.57
7.4.220.0070.00616.57
7.4.210.0090.00516.56
7.4.200.0060.00416.61
7.4.190.0030.00916.63
7.4.180.0040.00716.52
7.4.160.0030.00916.49
7.4.150.0060.00716.80
7.4.140.0100.00517.16
7.4.130.0080.00716.59
7.4.120.0080.00716.51
7.4.110.0090.00616.50
7.4.100.0090.00716.52
7.4.90.0070.00816.53
7.4.80.0070.00717.22
7.4.70.0080.00516.46
7.4.60.0070.00716.33
7.4.50.0060.00616.38
7.4.40.0080.00616.47
7.4.30.0080.00716.47
7.4.20.0070.00816.51
7.4.10.0090.00616.44
7.4.00.0060.00915.73
7.3.330.0060.00414.68
7.3.320.0060.00414.67
7.3.310.0100.00116.14
7.3.300.0070.00316.22
7.3.290.0040.00616.24
7.3.280.0090.00616.23
7.3.270.0120.00116.62
7.3.260.0040.00916.24
7.3.250.0100.00516.27
7.3.240.0090.00516.27
7.3.230.0080.00616.31
7.3.220.0080.00716.22
7.3.210.0110.00516.26
7.3.200.0080.00917.01
7.3.190.0100.00516.32
7.3.180.0100.00616.32
7.3.170.0070.00716.31
7.3.160.0110.00516.20
7.3.150.0060.00916.05
7.3.140.0080.00716.18
7.3.130.0090.00616.19
7.3.120.0080.00815.51
7.3.110.0100.00715.45
7.3.100.0100.00615.39
7.3.90.0090.00815.57
7.3.80.0080.00915.29
7.3.70.0090.00715.36
7.3.60.0090.00715.36
7.3.50.0070.00915.39
7.3.40.0070.00815.38
7.3.30.0080.00815.42
7.3.20.0160.00815.73
7.3.10.0160.00815.72
7.3.00.0170.00715.79
7.2.340.0070.00816.40
7.2.330.0090.00816.50
7.2.320.0080.00916.45
7.2.310.0080.00716.42
7.2.300.0070.00816.42
7.2.290.0090.00616.55
7.2.280.0060.01116.34
7.2.270.0070.00816.35
7.2.260.0060.01016.50
7.2.250.0100.00615.93
7.2.240.0080.00715.75
7.2.230.0090.00715.69
7.2.220.0070.00915.76
7.2.210.0090.00615.68
7.2.200.0080.00815.71
7.2.190.0090.00915.67
7.2.180.0090.00615.74
7.2.170.0070.00915.74
7.2.160.0100.00715.64
7.2.150.0200.00816.11
7.2.140.0200.00916.02
7.2.130.0270.00616.16
7.2.120.0190.00815.87
7.2.110.0190.00815.94
7.2.100.0240.00815.86
7.2.90.0190.00615.86
7.2.80.0170.00815.84
7.2.70.0180.00615.92
7.2.60.0180.00816.02
7.2.50.0180.00715.89
7.2.40.0180.00915.95
7.2.30.0170.00815.94
7.2.20.0180.00715.94
7.2.10.0210.00916.07
7.2.00.0190.00716.09
7.1.330.0150.00415.12
7.1.320.0070.00915.16
7.1.310.0080.00915.10
7.1.300.0090.00814.97
7.1.290.0130.00615.00
7.1.280.0100.00915.01
7.1.270.0110.00815.04
7.1.260.0100.00914.97
7.1.250.0200.00614.94
7.1.240.0190.00814.65
7.1.230.0220.00714.67
7.1.220.0270.00714.63
7.1.210.0200.00914.67
7.1.200.0190.00714.75
7.1.190.0160.00914.69
7.1.180.0180.00914.56
7.1.170.0180.00714.68
7.1.160.0170.00814.60
7.1.150.0240.00614.65
7.1.140.0170.00914.67
7.1.130.0230.00814.90
7.1.120.0220.00714.84
7.1.110.0210.00714.75
7.1.100.0200.00714.76
7.1.90.0190.00615.14
7.1.80.0180.00815.23
7.1.70.0160.00714.97
7.1.60.0190.00818.62
7.1.50.0220.00718.57
7.1.40.0200.00918.49
7.1.30.0190.00818.48
7.1.20.0200.00818.54
7.1.10.0160.00914.99
7.1.00.0430.00814.92
7.0.330.0180.01014.56
7.0.320.0200.00814.29
7.0.310.0190.00814.32
7.0.300.0190.00814.37
7.0.290.0190.00814.35
7.0.280.0180.00814.35
7.0.270.0200.00914.52
7.0.260.0200.00814.49
7.0.250.0180.00714.51
7.0.240.0220.00714.45
7.0.230.0160.00814.87
7.0.220.0180.00714.91
7.0.210.0160.00814.69
7.0.200.0160.00814.73
7.0.190.0230.00814.66
7.0.180.0210.00714.64
7.0.170.0170.00614.64
7.0.160.0160.00714.54
7.0.150.0170.00814.58
7.0.140.0150.00814.61
7.0.130.0310.00914.70
7.0.120.0190.00614.69
7.0.110.0170.00614.58
7.0.100.0180.00714.61
7.0.90.0150.00814.55
7.0.80.0150.00714.60
7.0.70.0160.00814.54
7.0.60.0160.00814.50
7.0.50.0170.00614.66
7.0.40.0160.00814.70
7.0.30.0150.00714.64
7.0.20.0210.00614.58
7.0.10.0210.00714.67
7.0.00.0180.00614.60
5.6.400.0130.00715.09
5.6.390.0110.00815.15
5.6.380.0120.00814.83
5.6.370.0120.00914.91
5.6.360.0130.00714.90
5.6.350.0110.00914.86
5.6.340.0130.00714.92
5.6.330.0130.00814.89
5.6.320.0130.00715.00
5.6.310.0110.00915.00
5.6.300.0130.01716.07
5.6.290.0120.01916.10
5.6.280.0100.02016.18
5.6.270.0120.01916.08
5.6.260.0140.01816.11
5.6.250.0110.01916.12
5.6.240.0120.01816.09
5.6.230.0100.02016.14
5.6.220.0120.01916.09
5.6.210.0120.01816.06
5.6.200.0100.01916.09
5.6.190.0110.01816.14
5.6.180.0130.01816.11
5.6.170.0110.01816.03
5.6.160.0110.01816.08
5.6.150.0110.02016.05
5.6.140.0110.02016.09
5.6.130.0110.02016.06
5.6.120.0120.01816.14
5.6.110.0110.01916.03
5.6.100.0120.01716.11
5.6.90.0120.01816.09
5.6.80.0100.01915.88
5.6.70.0120.01816.00
5.6.60.0130.01815.94
5.6.50.0110.01915.97
5.6.40.0110.01715.93
5.6.30.0120.01715.90
5.6.20.0110.01915.88
5.6.10.0110.01715.91
5.6.00.0100.01915.90
5.5.380.0120.01614.82
5.5.370.0110.01914.83
5.5.360.0110.01714.71
5.5.350.0100.01914.68
5.5.340.0110.01814.86
5.5.330.0120.01714.80
5.5.320.0120.01614.83
5.5.310.0120.01714.88
5.5.300.0130.01914.89
5.5.290.0100.02014.85
5.5.280.0110.01714.84
5.5.270.0100.01914.88
5.5.260.0130.01714.81
5.5.250.0120.01914.78
5.5.240.0120.01514.72
5.5.230.0130.02014.67
5.5.220.0120.01614.76
5.5.210.0130.01714.73
5.5.200.0120.01814.69
5.5.190.0120.01714.67
5.5.180.0120.01714.73
5.5.170.0120.00914.51
5.5.160.0120.01714.74
5.5.150.0120.02014.66
5.5.140.0110.01814.57
5.5.130.0110.01814.67
5.5.120.0100.01914.63
5.5.110.0140.01514.69
5.5.100.0100.02014.60
5.5.90.0110.01714.68
5.5.80.0110.01714.67
5.5.70.0120.01814.67
5.5.60.0140.01414.64
5.5.50.0100.01914.66
5.5.40.0120.01714.67
5.5.30.0110.01714.61
5.5.20.0110.02014.63
5.5.10.0130.01614.63
5.5.00.0100.01914.65
5.4.450.0100.01613.34
5.4.440.0090.01613.36
5.4.430.0100.01713.27
5.4.420.0110.01413.25
5.4.410.0100.01613.31
5.4.400.0110.01413.22
5.4.390.0090.01813.23
5.4.380.0120.01513.19
5.4.370.0090.01713.23
5.4.360.0110.01613.24
5.4.350.0090.01813.24
5.4.340.0130.01413.17
5.4.330.0100.00611.74
5.4.320.0090.01913.23
5.4.310.0110.01513.19
5.4.300.0120.01613.24
5.4.290.0120.01413.24
5.4.280.0080.01713.17
5.4.270.0110.01513.15
5.4.260.0110.01513.12
5.4.250.0070.01713.16
5.4.240.0110.01513.17
5.4.230.0100.01613.15
5.4.220.0110.01613.18
5.4.210.0100.01513.14
5.4.200.0130.01513.18
5.4.190.0100.01813.12
5.4.180.0100.01713.17
5.4.170.0110.01513.21
5.4.160.0090.01713.14
5.4.150.0110.01613.15
5.4.140.0110.01412.73
5.4.130.0110.01312.69
5.4.120.0100.01512.79
5.4.110.0100.01412.78
5.4.100.0120.01212.72
5.4.90.0090.01512.72
5.4.80.0080.01712.72
5.4.70.0080.01712.72
5.4.60.0100.01512.72
5.4.50.0090.01612.73
5.4.40.0100.01412.71
5.4.30.0090.01612.68
5.4.20.0110.01512.69
5.4.10.0070.01612.72
5.4.00.0090.01512.62
5.3.290.0100.01612.28
5.3.280.0090.01512.18
5.3.270.0090.01712.23
5.3.260.0090.01712.23
5.3.250.0100.01512.25
5.3.240.0080.01512.15
5.3.230.0110.01512.21
5.3.220.0110.01312.12
5.3.210.0090.01612.10
5.3.200.0100.01612.11
5.3.190.0120.01412.12
5.3.180.0090.01612.24
5.3.170.0110.01612.25
5.3.160.0090.01512.19
5.3.150.0080.01612.22
5.3.140.0100.01512.15
5.3.130.0100.01612.16
5.3.120.0100.01612.19
5.3.110.0100.01512.16
5.3.100.0100.01412.04
5.3.90.0100.01412.11
5.3.80.0090.01411.98
5.3.70.0090.01411.99
5.3.60.0090.01412.08
5.3.50.0100.01611.98
5.3.40.0100.01412.00
5.3.30.0080.01512.00
5.3.20.0090.01511.94
5.3.10.0080.01511.85
5.3.00.0110.01411.79

preferences:
55.22 ms | 401 KiB | 5 Q