3v4l.org

run code in 300+ PHP versions simultaneously
<?php class ArrayAsKeyIterator extends IteratorIterator { public function key() { return array('1', parent::key()); } } $it = new ArrayAsKeyIterator(new ArrayIterator(range(0, 1))); iterator_count($it); $it->rewind(); $it->key(); var_dump($it->current(), $it->key()); $array = iterator_to_array($it, FALSE); // because it is wrapped into an iterator iterator, see: $itit = new IteratorIterator($it); $array = iterator_to_array($itit, FALSE);

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.00316.63
8.3.50.0230.01017.27
8.3.40.0080.00818.80
8.3.30.0090.00618.76
8.3.20.0090.00318.79
8.3.10.0040.00418.73
8.3.00.0080.00019.38
8.2.180.0030.01216.50
8.2.170.0120.00322.96
8.2.160.0040.01118.83
8.2.150.0060.00324.18
8.2.140.0090.00324.66
8.2.130.0140.00326.16
8.2.120.0070.00020.95
8.2.110.0040.00420.30
8.2.100.0070.00717.72
8.2.90.0000.00817.63
8.2.80.0050.00318.83
8.2.70.0000.00917.63
8.2.60.0030.00517.93
8.2.50.0080.00018.07
8.2.40.0060.00319.24
8.2.30.0060.00417.76
8.2.20.0000.00917.54
8.2.10.0030.00617.71
8.2.00.0080.00017.70
8.1.280.0060.00825.92
8.1.270.0000.00723.99
8.1.260.0030.00526.35
8.1.250.0060.00328.09
8.1.240.0000.00919.01
8.1.230.0040.00717.64
8.1.220.0000.00817.74
8.1.210.0030.00618.77
8.1.200.0000.00917.25
8.1.190.0040.00417.36
8.1.180.0000.01018.10
8.1.170.0000.00818.89
8.1.160.0000.00718.94
8.1.150.0000.00718.70
8.1.140.0040.00417.44
8.1.130.0040.00419.28
8.1.120.0000.00717.53
8.1.110.0000.00717.32
8.1.100.0000.00717.48
8.1.90.0040.00417.37
8.1.80.0000.00717.46
8.1.70.0000.00717.43
8.1.60.0080.00017.56
8.1.50.0050.00317.53
8.1.40.0030.00617.46
8.1.30.0060.00317.50
8.1.20.0000.00817.63
8.1.10.0040.00417.56
8.1.00.0040.00417.50
8.0.300.0070.00018.77
8.0.290.0000.00716.63
8.0.280.0000.00718.50
8.0.270.0070.00017.19
8.0.260.0000.00616.75
8.0.250.0070.00316.94
8.0.240.0030.00617.01
8.0.230.0000.00717.02
8.0.220.0040.00416.95
8.0.210.0000.00716.86
8.0.200.0040.00416.83
8.0.190.0000.00716.93
8.0.180.0000.00716.91
8.0.170.0050.00316.76
8.0.160.0070.00016.77
8.0.150.0040.00416.74
8.0.140.0000.00716.82
8.0.130.0030.00313.33
8.0.120.0090.00016.87
8.0.110.0040.00416.78
8.0.100.0040.00416.88
8.0.90.0000.00817.00
8.0.80.0110.00416.80
8.0.70.0080.00016.93
8.0.60.0060.00316.88
8.0.50.0000.00716.84
8.0.30.0100.01017.02
8.0.20.0100.00816.94
8.0.10.0050.00317.00
8.0.00.0090.00816.64
7.4.330.0000.00413.07
7.4.320.0000.00816.41
7.4.300.0040.00416.61
7.4.290.0060.00316.50
7.4.280.0000.00816.43
7.4.270.0000.00716.57
7.4.260.0050.00013.25
7.4.250.0050.00316.40
7.4.240.0030.00316.64
7.4.230.0030.00616.28
7.4.220.0070.01116.63
7.4.210.0160.00616.52
7.4.200.0030.00416.36
7.4.190.0050.00216.68
7.4.160.0080.00816.31
7.4.150.0140.00416.71
7.4.140.0040.01916.50
7.4.130.0080.00816.41
7.4.120.0110.00616.74
7.4.110.0000.01716.72
7.4.100.0090.00916.43
7.4.90.0170.00716.61
7.4.80.0100.01019.39
7.4.70.0070.01016.46
7.4.60.0130.00316.44
7.4.50.0040.00416.57
7.4.40.0090.00616.45
7.4.30.0090.00916.42
7.4.00.0090.00614.63
7.3.330.0030.00313.28
7.3.320.0000.00613.31
7.3.310.0040.00416.15
7.3.300.0030.00316.26
7.3.290.0140.00316.33
7.3.280.0120.00616.26
7.3.270.0100.00716.63
7.3.260.0100.00716.57
7.3.250.0100.00816.56
7.3.240.0110.00516.29
7.3.230.0070.01716.52
7.3.210.0110.00616.27
7.3.200.0140.00816.49
7.3.190.0080.00816.41
7.3.180.0100.00616.30
7.3.170.0080.00816.34
7.3.160.0160.00316.39
7.3.120.0130.00314.49
7.2.330.0140.00316.56
7.2.320.0060.01116.80
7.2.310.0110.01216.71
7.2.300.0140.00316.80
7.2.290.0090.00916.51
7.2.00.0100.00719.10
7.1.100.0030.00918.07
7.1.70.0080.00317.20
7.1.60.0110.01419.30
7.1.50.0070.01716.76
7.1.00.0070.07322.50
7.0.200.0050.00516.57
7.0.140.0030.07321.97
7.0.120.0070.07022.25
7.0.60.0100.07319.95
7.0.50.0070.04017.79
7.0.40.0000.06720.04
7.0.30.0230.07020.15
7.0.20.0270.04720.23
7.0.10.0100.08320.23
7.0.00.0030.08720.20
5.6.280.0000.07721.14
5.6.210.0130.03720.61
5.6.200.0100.05718.19
5.6.190.0030.05020.56
5.6.180.0370.04020.63
5.6.170.0400.07020.71
5.6.160.0000.04720.46
5.6.150.0030.08718.18
5.6.140.0030.07318.24
5.6.130.0070.07318.23
5.6.120.0070.06321.02
5.6.110.0270.06721.12
5.6.100.0070.07321.04
5.6.90.0030.07720.93
5.6.80.0070.03720.37
5.5.350.0000.05020.34
5.5.340.0070.04717.95
5.5.330.0030.08720.43
5.5.320.1570.06020.24
5.5.310.0270.07320.50
5.5.300.0070.07017.98
5.5.290.0070.03718.09
5.5.280.0000.04720.95
5.5.270.0030.05020.88
5.5.260.0130.06720.87
5.5.250.0070.06320.69
5.5.240.0070.07720.27
5.4.450.0670.04019.52
5.4.440.0100.04319.16
5.4.430.0800.03719.33
5.4.420.0270.05719.39
5.4.410.0830.04319.02
5.4.400.0470.04019.04
5.4.390.0930.03019.34
5.4.380.0270.05019.07
5.4.370.0630.03719.15
5.4.360.0570.04019.14
5.4.350.0530.02719.31
5.4.340.0800.03018.96
5.4.320.0270.05318.96
5.4.310.0400.04719.30
5.4.300.0770.03319.22
5.4.290.0970.03319.21
5.4.280.0330.04719.20
5.4.270.0470.04019.19
5.4.260.0400.05019.13
5.4.250.0630.04318.95
5.4.240.0600.03719.18
5.4.230.0400.05318.84
5.4.220.0930.03718.96
5.4.210.0330.03319.04
5.4.200.1030.04019.12
5.4.190.0900.02719.22
5.4.180.0830.03719.21
5.4.170.0670.03719.21
5.4.160.0630.03719.09
5.4.150.0570.04319.18
5.4.140.0470.04316.40
5.4.130.0630.04016.50
5.4.120.0470.04316.35
5.4.110.0400.03716.19
5.4.100.0430.04316.43
5.4.90.0670.03016.38
5.4.80.0630.04016.50
5.4.70.0500.03316.34
5.4.60.0270.04016.52
5.4.50.0330.03016.31
5.4.40.0030.04316.48
5.4.30.0100.03016.33
5.4.20.0600.03716.43
5.4.10.0330.04716.35
5.4.00.0770.03015.82
5.3.290.0430.04015.08
5.3.280.0430.03315.08
5.3.270.0530.04315.08
5.3.260.0370.04715.08
5.3.250.0670.04715.08
5.3.240.0370.03715.08
5.3.230.0430.04315.08
5.3.220.0470.03715.08
5.3.210.0170.04015.08
5.3.200.0300.04015.08
5.3.190.0200.04715.08
5.3.180.0870.03015.08
5.3.170.0770.03715.08
5.3.160.0300.03315.07
5.3.150.0300.04315.07
5.3.140.0670.03715.07
5.3.130.0270.03715.07
5.3.120.0730.04715.07
5.3.110.0530.04315.07
5.3.100.0900.03015.07
5.3.90.0270.03715.07
5.3.80.0270.03315.07
5.3.70.0230.04715.07
5.3.60.0570.03015.07
5.3.50.0570.03715.07
5.3.40.0570.03315.07
5.3.30.0530.03715.07
5.3.20.0570.04715.05
5.3.10.0870.03715.05
5.3.00.0800.04015.05
5.2.170.0500.03315.07
5.2.160.0200.03015.07
5.2.150.0430.03315.07
5.2.140.0500.03715.05
5.2.130.0530.03315.05
5.2.120.0630.03315.05
5.2.110.0570.03315.05
5.2.100.0270.03015.05
5.2.90.0200.03015.05
5.2.80.0100.03015.05
5.2.70.0200.03315.05
5.2.60.0170.02715.05
5.2.50.0100.02715.05
5.2.40.0170.03315.05
5.2.30.0100.03715.05
5.2.20.0100.02015.05
5.2.10.0300.02715.05
5.2.00.0300.03015.05
5.1.60.0500.05015.05
5.1.50.0430.01715.05
5.1.40.0300.02315.05
5.1.30.0170.02715.05
5.1.20.0000.02315.05
5.1.10.0070.02015.05
5.1.00.0530.02315.05
5.0.50.0170.02315.05
5.0.40.0100.01715.05
5.0.30.0070.03315.05
5.0.20.0030.01715.05
5.0.10.0070.01715.05
5.0.00.0070.03315.05
4.4.90.0030.04315.05
4.4.80.0030.02315.05
4.4.70.0030.02015.05
4.4.60.0200.00715.05
4.4.50.0200.01315.05
4.4.40.0370.02015.05
4.4.30.0230.01315.05
4.4.20.0200.01315.05
4.4.10.0100.01715.05
4.4.00.0030.02715.05
4.3.110.0030.01315.05
4.3.100.0070.01315.05
4.3.90.0100.01315.05
4.3.80.0070.02315.05
4.3.70.0100.01015.05
4.3.60.0030.02715.05
4.3.50.0030.01715.05
4.3.40.0030.03015.05
4.3.30.0070.01715.05
4.3.20.0000.03715.05
4.3.10.0100.01315.05
4.3.00.0100.01315.05

preferences:
53.76 ms | 401 KiB | 5 Q