3v4l.org

run code in 300+ PHP versions simultaneously
<?php class EmptyIterator implements Iterator, Countable { /** No operation. * @return void */ function rewind() { // nothing to do } /** @return \c false */ function valid() { return false; } /** This function must not be called. It throws an exception upon access. * @throw Exception * @return void */ function current() { throw new Exception('Accessing the value of an EmptyIterator'); } /** This function must not be called. It throws an exception upon access. * @throw Exception * @return void */ function key() { throw new Exception('Accessing the key of an EmptyIterator'); } /** No operation. * @return void */ function next() { // nothing to do } /** * @return int */ function count() { return 0; } } $ei = new EmptyIterator; echo count($ei);

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.0110.01122.04
8.3.40.0110.00418.67
8.3.30.0030.01019.09
8.3.20.0050.00220.16
8.3.10.0040.00423.54
8.3.00.0090.00317.50
8.2.180.0110.01118.31
8.2.170.0100.00722.96
8.2.160.0130.00020.39
8.2.150.0000.00824.18
8.2.140.0030.00524.66
8.2.130.0030.00626.16
8.2.120.0040.00422.11
8.2.110.0080.00022.26
8.2.100.0030.00917.67
8.2.90.0000.00819.15
8.2.80.0040.00417.97
8.2.70.0000.00817.62
8.2.60.0000.00917.89
8.2.50.0080.00018.07
8.2.40.0000.00818.09
8.2.30.0090.00018.06
8.2.20.0040.00417.69
8.2.10.0070.00018.06
8.2.00.0100.00017.70
8.1.280.0030.01025.92
8.1.270.0030.00623.96
8.1.260.0050.00226.35
8.1.250.0040.00428.09
8.1.240.0030.00623.75
8.1.230.0100.00318.97
8.1.220.0030.00517.74
8.1.210.0000.00818.77
8.1.200.0030.00617.22
8.1.190.0040.00417.53
8.1.180.0040.00418.10
8.1.170.0000.00918.46
8.1.160.0040.00421.95
8.1.150.0040.00418.45
8.1.140.0040.00417.30
8.1.130.0030.00317.69
8.1.120.0040.00417.41
8.1.110.0070.00017.28
8.1.100.0000.00717.41
8.1.90.0030.00317.36
8.1.80.0030.00517.29
8.1.70.0070.00017.33
8.1.60.0000.00717.55
8.1.50.0000.00817.46
8.1.40.0050.00317.46
8.1.30.0040.00417.49
8.1.20.0040.00417.59
8.1.10.0000.00817.28
8.1.00.0000.00717.33
8.0.300.0000.00718.77
8.0.290.0000.00816.93
8.0.280.0030.00318.32
8.0.270.0000.00717.11
8.0.260.0000.00618.35
8.0.250.0000.00716.87
8.0.240.0080.00016.86
8.0.230.0040.00416.89
8.0.220.0070.00016.92
8.0.210.0030.00316.88
8.0.200.0030.00517.00
8.0.190.0040.00416.98
8.0.180.0000.00716.85
8.0.170.0040.00417.01
8.0.160.0040.00416.87
8.0.150.0000.00816.80
8.0.140.0000.00816.82
8.0.130.0030.00313.29
8.0.120.0040.00416.74
8.0.110.0050.00316.80
8.0.100.0000.00716.75
8.0.90.0020.00516.85
8.0.80.0090.00616.88
8.0.70.0000.00716.76
8.0.60.0000.00716.95
8.0.50.0000.00716.85
8.0.30.0140.00517.09
8.0.20.0100.00817.40
8.0.10.0040.00416.97
8.0.00.0050.01216.71
7.4.330.0000.00615.00
7.4.320.0030.00616.35
7.4.300.0040.00416.44
7.4.290.0000.00716.34
7.4.280.0030.00316.57
7.4.270.0040.00416.57
7.4.260.0040.00416.43
7.4.250.0030.00316.50
7.4.240.0050.00216.47
7.4.230.0000.00716.61
7.4.220.0110.00816.57
7.4.210.0060.00916.56
7.4.200.0040.00416.63
7.4.190.0040.00416.35
7.4.160.0030.01316.27
7.4.150.0130.00517.40
7.4.140.0100.00817.86
7.4.130.0070.00916.54
7.4.120.0100.00716.49
7.4.110.0130.00616.47
7.4.100.0130.00616.63
7.4.90.0130.00416.25
7.4.80.0060.01619.39
7.4.70.0110.00616.45
7.4.60.0060.00916.27
7.4.50.0000.00816.35
7.4.40.0070.01022.77
7.4.30.0110.00716.35
7.4.00.0130.00315.20
7.3.330.0050.00013.17
7.3.320.0000.00513.25
7.3.310.0000.00716.20
7.3.300.0030.00316.07
7.3.290.0060.00916.29
7.3.280.0110.00416.22
7.3.270.0100.01017.40
7.3.260.0120.00616.57
7.3.250.0120.00916.35
7.3.240.0130.00316.52
7.3.230.0070.01016.48
7.3.210.0090.00916.15
7.3.200.0070.01019.39
7.3.190.0170.00616.38
7.3.180.0060.00916.26
7.3.170.0030.01216.52
7.3.160.0090.00916.38
7.3.120.0040.01214.58
7.2.330.0060.01216.61
7.2.320.0130.00516.55
7.2.310.0080.01216.63
7.2.300.0000.01816.60
7.2.290.0080.00816.35
7.2.60.0070.00716.87
7.1.200.0040.01115.68
7.1.100.0040.00717.64
7.1.70.0090.00616.86
7.1.60.0100.00319.33
7.1.50.0030.01616.88
7.1.00.0070.06322.28
7.0.200.2570.00314.79
7.0.140.0030.07022.04
7.0.60.0100.08319.95
7.0.50.0100.07717.88
7.0.40.0100.08320.18
7.0.30.0270.07720.08
7.0.20.0230.08320.07
7.0.10.0100.08320.30
7.0.00.0170.07020.32
5.6.280.0100.06720.93
5.6.210.0130.07020.52
5.6.200.0070.08718.16
5.6.190.0130.08020.77
5.6.180.0030.04720.48
5.6.170.0330.07020.38
5.6.160.0100.07320.55
5.6.150.0170.07018.21
5.6.140.0130.06718.28
5.6.130.0030.08718.18
5.6.120.0000.04321.02
5.6.110.0030.04320.98
5.6.100.0030.05021.13
5.6.90.0070.08020.96
5.6.80.0030.03720.54
5.6.70.3670.03720.51
5.5.350.0170.07320.41
5.5.340.0070.05717.93
5.5.330.0070.08320.44
5.5.320.0430.05720.42
5.5.310.0230.07320.33
5.5.300.0000.06317.94
5.5.290.0000.08717.99
5.5.280.0030.04320.88
5.5.270.0030.04320.77
5.5.260.0170.07320.84
5.5.250.0100.04320.59
5.5.240.0170.07020.18
5.4.450.0200.06019.38
5.4.440.0170.06319.70
5.4.430.0300.05319.57
5.4.420.0200.05319.44
5.4.410.0230.05319.02
5.4.400.0300.07019.31
5.4.390.0270.06718.83
5.4.380.0400.06718.73
5.4.370.0270.05318.80
5.4.360.0370.05318.81
5.4.350.0270.05318.70
5.4.340.0200.05718.75
5.4.320.0050.03712.50
5.4.310.0050.04212.50
5.4.300.0100.03812.50
5.4.290.0050.04112.50
5.4.280.0050.04012.37
5.4.270.0100.03912.37
5.4.260.0080.05312.38
5.4.250.0100.05412.37
5.4.240.0100.04712.37
5.4.230.0140.04412.37
5.4.220.0110.04812.36
5.4.210.0140.04512.36
5.4.200.0130.05112.36
5.4.190.0080.05312.36
5.4.180.0120.04912.36
5.4.170.0100.05012.37
5.4.160.0070.05412.36
5.4.150.0070.05212.37
5.4.140.0070.05112.05
5.4.130.0100.04912.04
5.4.120.0080.04912.00
5.4.110.0060.04811.99
5.4.100.0070.05111.98
5.4.90.0100.05311.99
5.4.80.0100.04911.99
5.4.70.0110.03811.98
5.4.60.0040.04211.98
5.4.50.0060.03511.98
5.4.40.0040.03811.97
5.4.30.0090.03811.97
5.4.20.0070.03611.97
5.4.10.0090.03611.97
5.4.00.0050.03611.45
5.3.290.0050.04012.80
5.3.280.0070.03912.71
5.3.270.0120.03612.72
5.3.260.0070.04012.72
5.3.250.0020.04312.72
5.3.240.0080.04012.72
5.3.230.0080.03712.70
5.3.220.0050.04012.68
5.3.210.0060.03912.68
5.3.200.0120.03112.68
5.3.190.0080.03712.68
5.3.180.0060.03912.68
5.3.170.0080.03612.67
5.3.160.0140.04212.68
5.3.150.0100.04112.67
5.3.140.0050.03912.66
5.3.130.0060.03812.66
5.3.120.0090.03612.66
5.3.110.0110.03412.66
5.3.100.0110.03412.12
5.3.90.0060.03612.09
5.3.80.0070.04312.08
5.3.70.0110.03512.08
5.3.60.0110.03312.07
5.3.50.0050.03912.01
5.3.40.0080.03612.00
5.3.30.0070.03411.96
5.3.20.0070.03711.74
5.3.10.0060.03711.71
5.3.00.0050.04011.70
5.2.170.0030.0349.20
5.2.160.0080.0279.20
5.2.150.0080.0289.20
5.2.140.0080.0319.20
5.2.130.0040.0319.15
5.2.120.0050.0319.16
5.2.110.0080.0329.16
5.2.100.0110.0289.16
5.2.90.0100.0339.15
5.2.80.0080.0309.15
5.2.70.0110.0359.15
5.2.60.0060.0429.10
5.2.50.0040.0329.08
5.2.40.0100.0259.05
5.2.30.0060.0409.03
5.2.20.0080.0299.01
5.2.10.0070.0328.92
5.2.00.0040.0308.79
5.1.60.0050.0238.08
5.1.50.0040.0268.08
5.1.40.0090.0318.06
5.1.30.0080.0328.41
5.1.20.0090.0248.43
5.1.10.0060.0258.16
5.1.00.0040.0268.15
5.0.50.0070.0246.63
5.0.40.0020.0276.49
5.0.30.0060.0336.30
5.0.20.0020.0216.27
5.0.10.0040.0196.25
5.0.00.0080.0356.24
4.4.90.0070.0224.78
4.4.80.0040.0154.76
4.4.70.0070.0124.75
4.4.60.0030.0214.76
4.4.50.0060.0174.77
4.4.40.0040.0314.71
4.4.30.0050.0194.76
4.4.20.0040.0214.84
4.4.10.0060.0204.85
4.4.00.0060.0344.76
4.3.110.0070.0164.67
4.3.100.0050.0254.66
4.3.90.0040.0194.64
4.3.80.0050.0304.59
4.3.70.0070.0224.63
4.3.60.0040.0184.63
4.3.50.0060.0134.63
4.3.40.0030.0354.54
4.3.30.0040.0163.28
4.3.20.0080.0303.26
4.3.10.0060.0193.23
4.3.00.0030.0207.81

preferences:
46.28 ms | 401 KiB | 5 Q