3v4l.org

run code in 300+ PHP versions simultaneously
<?php class EmptyIterator extends Iterator implements 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.0140.00716.63
8.3.50.0110.00621.92
8.3.40.0070.01418.67
8.3.30.0030.01019.10
8.3.20.0080.00820.38
8.3.10.0000.00823.46
8.3.00.0090.00019.13
8.2.180.0040.01818.08
8.2.170.0030.01222.96
8.2.160.0080.00520.47
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0080.00022.25
8.2.110.0080.00022.11
8.2.100.0070.00417.84
8.2.90.0040.00419.05
8.2.80.0000.00817.97
8.2.70.0000.00917.50
8.2.60.0000.00817.80
8.2.50.0000.00818.07
8.2.40.0040.00418.13
8.2.30.0000.00718.00
8.2.20.0040.00417.72
8.2.10.0030.00517.88
8.2.00.0030.00717.68
8.1.280.0140.00325.92
8.1.270.0000.00822.01
8.1.260.0000.00826.35
8.1.250.0060.00328.09
8.1.240.0040.00424.01
8.1.230.0040.00719.00
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0030.00617.22
8.1.190.0040.00417.30
8.1.180.0000.00818.10
8.1.170.0040.00418.56
8.1.160.0000.00722.05
8.1.150.0040.00418.45
8.1.140.0040.00417.39
8.1.130.0030.00317.64
8.1.120.0000.00717.33
8.1.110.0000.00817.38
8.1.100.0000.00817.46
8.1.90.0040.00417.41
8.1.80.0040.00417.41
8.1.70.0070.00017.40
8.1.60.0040.00417.42
8.1.50.0080.00017.45
8.1.40.0030.00617.40
8.1.30.0030.00617.50
8.1.20.0040.00417.57
8.1.10.0030.00617.40
8.1.00.0000.00717.21
8.0.300.0070.00018.77
8.0.290.0040.00417.05
8.0.280.0030.00518.38
8.0.270.0040.00417.31
8.0.260.0000.00617.11
8.0.250.0000.00717.00
8.0.240.0050.00316.91
8.0.230.0070.00016.86
8.0.220.0000.00716.89
8.0.210.0030.00316.80
8.0.200.0050.00316.82
8.0.190.0040.00416.98
8.0.180.0020.00516.88
8.0.170.0030.00516.81
8.0.160.0040.00416.77
8.0.150.0040.00416.86
8.0.140.0000.00816.86
8.0.130.0000.00513.41
8.0.120.0030.00616.86
8.0.110.0030.00416.89
8.0.100.0080.00016.76
8.0.90.0040.00416.96
8.0.80.0070.01416.89
8.0.70.0040.00416.88
8.0.60.0040.00416.89
8.0.50.0050.00316.74
8.0.30.0080.01017.03
8.0.20.0100.01217.40
8.0.10.0040.00416.86
8.0.00.0050.01416.58
7.4.330.0000.00415.00
7.4.320.0000.00816.44
7.4.300.0000.00616.36
7.4.290.0030.00316.52
7.4.280.0030.00316.45
7.4.270.0050.00316.45
7.4.260.0030.00316.50
7.4.250.0000.00716.51
7.4.240.0030.00416.52
7.4.230.0030.00316.57
7.4.220.0140.00316.48
7.4.210.0070.00716.48
7.4.200.0000.00716.48
7.4.190.0000.00716.36
7.4.160.0100.00716.53
7.4.150.0120.00617.40
7.4.140.0090.00817.86
7.4.130.0120.00616.47
7.4.120.0090.00716.49
7.4.110.0180.00316.33
7.4.100.0130.00716.58
7.4.90.0090.00916.46
7.4.80.0100.00719.39
7.4.70.0100.01316.61
7.4.60.0130.00316.52
7.4.50.0000.00816.65
7.4.40.0000.01722.77
7.4.30.0150.00316.50
7.4.00.0000.01514.67
7.3.330.0020.00213.15
7.3.320.0050.00013.02
7.3.310.0080.00016.20
7.3.300.0030.00316.22
7.3.290.0060.01416.31
7.3.280.0100.00716.31
7.3.270.0160.00717.40
7.3.260.0170.00016.33
7.3.250.0150.00616.30
7.3.240.0110.00816.50
7.3.230.0030.01216.39
7.3.210.0120.00616.21
7.3.200.0090.01419.39
7.3.190.0110.00516.42
7.3.180.0090.00616.38
7.3.170.0090.00616.32
7.3.160.0100.00616.54
7.3.120.0100.00315.03
7.2.330.0060.01616.54
7.2.320.0110.01116.30
7.2.310.0070.01416.58
7.2.300.0040.01216.57
7.2.290.0100.00716.39
7.2.60.0040.01116.63
7.2.00.0000.01119.13
7.1.200.0080.00315.77
7.1.100.0030.01018.06
7.1.70.0000.01416.86
7.1.60.0070.01819.33
7.1.50.0100.01416.73
7.1.00.0070.07322.36
7.0.200.0450.00714.26
7.0.140.0070.07021.92
7.0.60.0200.07721.70
7.0.50.0100.04317.85
7.0.40.0100.03720.25
7.0.30.0200.04320.20
7.0.20.0370.07320.21
7.0.10.0100.04020.07
7.0.00.0130.03720.20
5.6.280.0030.07721.10
5.6.210.0030.07720.48
5.6.200.0030.08718.24
5.6.190.0170.07020.77
5.6.180.0370.08320.39
5.6.170.0330.08720.54
5.6.160.0070.04020.54
5.6.150.0130.07318.18
5.6.140.0200.06718.25
5.6.130.0000.08318.30
5.6.120.0030.05020.91
5.6.110.0200.05720.96
5.6.100.0130.07721.01
5.6.90.0130.08320.97
5.6.80.0130.07720.26
5.5.350.0130.04320.34
5.5.340.0000.05318.09
5.5.330.0070.05320.21
5.5.320.0430.04320.20
5.5.310.0300.07720.30
5.5.300.0130.07318.02
5.5.290.0100.07017.99
5.5.280.0100.05020.88
5.5.270.0100.05020.88
5.5.260.0030.08720.87
5.5.250.0030.08320.59
5.5.240.0130.08020.27
5.4.450.0370.07319.32
5.4.440.0270.04019.36
5.4.430.0270.05019.55
5.4.420.0330.07019.59
5.4.410.0370.06719.14
5.4.400.0400.06319.13
5.4.390.0370.02718.96
5.4.380.0370.03019.15
5.4.370.0300.05319.14
5.4.360.0370.06718.97
5.4.350.0330.04719.13
5.4.340.0270.04319.06
5.4.320.0300.07319.04
5.4.310.0270.03719.26
5.4.300.0370.06718.98
5.4.290.0230.04319.10
5.4.280.0370.06018.95
5.4.270.0400.04718.98
5.4.260.0470.06019.06
5.4.250.0270.04719.22
5.4.240.0400.06719.04
5.4.230.0330.05318.96
5.4.220.0300.05719.13
5.4.210.0330.07019.14
5.4.200.0230.04018.96
5.4.190.0400.06718.94
5.4.180.0370.07019.12
5.4.170.0430.06718.93
5.4.160.0330.06319.11
5.4.150.0230.07719.24
5.4.140.0430.06016.39
5.4.130.0330.07016.38
5.4.120.0470.05316.45
5.4.110.0370.05316.48
5.4.100.0430.06716.58
5.4.90.0370.05316.48
5.4.80.0300.05716.51
5.4.70.0230.05316.44
5.4.60.0330.04716.21
5.4.50.0370.05716.45
5.4.40.0400.04716.42
5.4.30.0470.05716.50
5.4.20.0330.04716.41
5.4.10.0430.05316.45
5.4.00.0400.06315.89
5.3.290.0200.04714.69
5.3.280.0370.06014.64
5.3.270.0330.07314.68
5.3.260.0370.04714.67
5.3.250.0370.06314.66
5.3.240.0330.07314.64
5.3.230.0300.04714.65
5.3.220.0270.07714.57
5.3.210.0330.04714.71
5.3.200.0330.07014.62
5.3.190.0370.05714.72
5.3.180.0400.06714.57
5.3.170.0470.05014.59
5.3.160.0270.05314.60
5.3.150.0370.05014.61
5.3.140.0300.07314.63
5.3.130.0430.02714.60
5.3.120.0470.06014.55
5.3.110.0270.04314.70
5.3.100.0300.03314.05
5.3.90.0270.03713.94
5.3.80.0270.03714.07
5.3.70.0300.03713.91
5.3.60.0370.03313.96
5.3.50.0200.05014.11
5.3.40.0370.04314.10
5.3.30.0330.04013.98
5.3.20.0370.03713.73
5.3.10.0330.04013.58
5.3.00.0300.07313.68
5.2.170.0300.05711.08
5.2.160.0270.05711.16
5.2.150.0300.03011.16
5.2.140.0330.02711.13
5.2.130.0200.03711.27
5.2.120.0430.04311.06
5.2.110.0200.03711.17
5.2.100.0330.05011.04
5.2.90.0270.05311.17
5.2.80.0300.02711.00
5.2.70.0300.04711.10
5.2.60.0200.06711.20
5.2.50.0300.02311.10
5.2.40.0270.05011.04
5.2.30.0230.03310.95
5.2.20.0300.05011.01
5.2.10.0270.04710.78
5.2.00.0230.03710.73
5.1.60.0230.0309.99
5.1.50.0230.03010.03
5.1.40.0170.0309.89
5.1.30.0230.05310.40
5.1.20.0300.04710.50
5.1.10.0300.04710.16
5.1.00.0200.03310.06
5.0.50.0100.0208.57
5.0.40.0100.0408.41
5.0.30.0130.0438.28
5.0.20.0130.0208.20
5.0.10.0130.0408.33
5.0.00.0170.0438.19
4.4.90.0070.0237.84
4.4.80.0130.0177.84
4.4.70.0200.0307.84
4.4.60.0200.0177.84
4.4.50.0100.0277.84
4.4.40.0100.0307.84
4.4.30.0100.0177.84
4.4.20.0170.0307.84
4.4.10.0130.0337.84
4.4.00.0100.0507.84
4.3.110.0130.0377.84
4.3.100.0100.0377.84
4.3.90.0100.0337.84
4.3.80.0100.0277.84
4.3.70.0170.0107.84
4.3.60.0130.0337.84
4.3.50.0130.0377.84
4.3.40.0100.0477.84
4.3.30.0070.0377.84
4.3.20.0070.0307.84
4.3.10.0000.0307.84
4.3.00.0070.0377.84

preferences:
53.19 ms | 401 KiB | 5 Q