3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test_array = array('Element 1', 'Element 2', 'Element 3', 'Element 4', 'Element 5', 'Element 6'); $infArray = array(1, 2, 3); $arrayIterator = new ArrayIterator($infArray); var_dump($arrayIterator->current()); $infiniteIterator = new InfiniteIterator(new ArrayIterator($infArray)); var_dump($infiniteIterator->current()); $limit = 10; foreach($test_array as $test){ echo $test . ' ' . $infiniteIterator->current() . '<br/>' . PHP_EOL; $infiniteIterator->next(); if (!($limit-->0)) { break; } }

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.0040.01116.38
8.3.50.0110.01021.00
8.3.40.0070.00718.51
8.3.30.0030.01019.10
8.3.20.0040.00420.38
8.3.10.0000.01023.61
8.3.00.0080.00019.12
8.2.180.0070.00718.14
8.2.170.0110.00322.96
8.2.160.0100.00320.52
8.2.150.0000.00724.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0040.00419.14
8.2.110.0030.00722.14
8.2.100.0070.00417.55
8.2.90.0040.00419.30
8.2.80.0080.00017.97
8.2.70.0000.00917.50
8.2.60.0090.00017.93
8.2.50.0040.00418.07
8.2.40.0040.00419.88
8.2.30.0100.00118.20
8.2.20.0050.00217.70
8.2.10.0030.00518.07
8.2.00.0000.00817.68
8.1.280.0000.01425.92
8.1.270.0080.00023.66
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0030.00723.86
8.1.230.0040.00819.21
8.1.220.0040.00417.79
8.1.210.0040.00418.77
8.1.200.0030.00617.22
8.1.190.0030.00617.23
8.1.180.0060.00318.10
8.1.170.0050.00518.57
8.1.160.0000.00722.10
8.1.150.0040.00418.55
8.1.140.0030.00617.51
8.1.130.0080.00017.91
8.1.120.0000.00717.47
8.1.110.0040.00417.49
8.1.100.0020.00517.37
8.1.90.0040.00417.51
8.1.80.0000.00817.39
8.1.70.0000.00817.46
8.1.60.0030.00617.55
8.1.50.0040.00417.51
8.1.40.0000.00717.46
8.1.30.0000.00817.57
8.1.20.0060.00317.71
8.1.10.0040.00417.56
8.1.00.0080.00017.41
8.0.300.0000.00818.77
8.0.290.0000.00717.16
8.0.280.0030.00318.41
8.0.270.0050.00317.28
8.0.260.0000.00617.23
8.0.250.0050.00216.94
8.0.240.0050.00516.87
8.0.230.0070.00016.88
8.0.220.0030.00316.82
8.0.210.0000.00716.79
8.0.200.0030.00316.89
8.0.190.0050.00316.98
8.0.180.0040.00416.93
8.0.170.0050.00316.81
8.0.160.0000.00716.98
8.0.150.0070.00016.86
8.0.140.0000.00916.83
8.0.130.0000.00613.34
8.0.120.0040.00416.81
8.0.110.0040.00416.87
8.0.100.0040.00416.73
8.0.90.0040.00416.93
8.0.80.0070.01316.94
8.0.70.0030.00516.95
8.0.60.0040.00417.02
8.0.50.0070.00016.88
8.0.30.0080.01016.90
8.0.20.0100.01017.40
8.0.10.0040.00417.09
8.0.00.0050.01316.75
7.4.330.0020.00215.00
7.4.320.0040.00416.38
7.4.300.0000.00616.52
7.4.290.0070.00016.59
7.4.280.0070.00016.55
7.4.270.0030.00316.63
7.4.260.0030.00316.61
7.4.250.0030.00716.50
7.4.240.0020.00616.58
7.4.230.0030.00316.32
7.4.220.0120.00616.43
7.4.210.0110.00716.59
7.4.200.0070.00016.68
7.4.190.0040.00416.52
7.4.160.0150.00616.45
7.4.150.0040.01417.40
7.4.140.0110.01017.86
7.4.130.0120.00816.44
7.4.120.0090.00916.55
7.4.110.0060.01316.62
7.4.100.0110.00716.38
7.4.90.0120.00616.57
7.4.80.0100.00919.39
7.4.70.0040.01216.43
7.4.60.0030.01916.48
7.4.50.0070.00016.58
7.4.40.0030.01316.49
7.4.30.0140.00316.37
7.4.00.0070.01015.11
7.3.330.0030.00313.13
7.3.320.0000.00513.12
7.3.310.0040.00416.36
7.3.300.0070.00016.13
7.3.290.0030.01016.39
7.3.280.0110.00716.25
7.3.270.0050.01217.40
7.3.260.0170.00016.73
7.3.250.0110.00716.59
7.3.240.0150.00616.55
7.3.230.0110.00616.43
7.3.210.0150.00516.51
7.3.200.0120.00619.39
7.3.190.0140.00716.55
7.3.180.0070.01416.57
7.3.170.0160.00316.37
7.3.160.0090.00616.47
7.3.120.0100.00314.88
7.3.10.0030.01316.63
7.3.00.0040.00816.60
7.2.330.0170.00516.59
7.2.320.0160.00816.58
7.2.310.0120.01116.65
7.2.300.0090.01216.43
7.2.290.0100.01016.68
7.2.130.0070.00717.05
7.2.120.0000.01617.02
7.2.110.0060.01216.93
7.2.100.0070.01116.76
7.2.90.0030.00616.96
7.2.80.0040.00817.07
7.2.70.0000.01516.79
7.2.60.0070.01016.92
7.2.50.0070.00716.92
7.2.40.0090.00916.98
7.2.30.0070.00317.19
7.2.20.0060.00916.73
7.2.10.0060.00916.80
7.2.00.0050.00818.24
7.1.250.0080.00515.91
7.1.100.0080.00318.30
7.1.70.0060.00917.12
7.1.60.0030.02219.46
7.1.50.0060.00916.56
7.1.00.0000.08022.43
7.0.200.0000.01016.76
7.0.140.0030.07721.95
7.0.60.0070.03719.88
7.0.50.0070.04017.82
7.0.40.0100.07020.04
7.0.30.0300.07020.13
7.0.20.0230.05320.01
7.0.10.0230.05320.12
7.0.00.0130.07720.01
5.6.280.0100.06720.89
5.6.210.0070.07020.66
5.6.200.0100.03318.12
5.6.190.0170.06720.63
5.6.180.3800.04320.61
5.6.170.0330.07720.38
5.6.160.0170.08020.32
5.6.150.0070.05318.21
5.6.140.0100.07718.21
5.6.130.0000.06018.21
5.6.120.0100.05321.13
5.6.110.0030.08721.14
5.6.100.0130.05721.03
5.6.90.0000.06020.87
5.6.80.0070.07720.53
5.6.70.0130.04320.37
5.5.350.0130.08320.49
5.5.340.0000.04017.94
5.5.330.0000.04720.57
5.5.320.0070.08020.40
5.5.310.0270.07720.28
5.5.300.0070.03717.98
5.5.290.0070.04017.98
5.5.280.0100.03720.80
5.5.270.0170.06320.72
5.5.260.0130.08020.88
5.5.250.0070.08020.61
5.5.240.0130.03020.18
5.4.450.0130.05019.55
5.4.440.0770.05019.54
5.4.430.0930.04719.31
5.4.420.0700.00019.32
5.4.410.0130.05718.91
5.4.400.0300.06718.49
5.4.390.0300.06018.57
5.4.380.0270.05018.50
5.4.370.0130.03318.63
5.4.360.0070.05318.61
5.4.350.0090.03711.98
5.4.340.0080.04111.97
5.4.320.0050.03712.46
5.4.310.0070.03712.45
5.4.300.0030.03912.45
5.4.290.0090.03912.45
5.4.280.0100.03812.35
5.4.270.0090.03712.35
5.4.260.0040.04212.35
5.4.250.0090.03812.35
5.4.240.0090.04012.35
5.4.230.0090.04112.34
5.4.220.0090.04312.34
5.4.210.0040.04112.34
5.4.200.0070.04712.34
5.4.190.0070.04012.34
5.4.180.0090.06612.34
5.4.170.0050.04612.35
5.4.160.0100.03912.35
5.4.150.0060.04012.34
5.4.140.0050.04212.02
5.4.130.0190.06812.01
5.4.120.0110.09911.98
5.4.110.0050.05411.97
5.4.100.0120.05711.96
5.4.90.0090.05311.96
5.4.80.0100.05511.96
5.4.70.0070.04711.96
5.4.60.0080.03811.97
5.4.50.0130.09111.96
5.4.40.0030.04111.95
5.4.30.0080.03911.95
5.4.20.0080.05411.95
5.4.10.0070.05611.95
5.4.00.0090.07011.45
5.3.290.0070.03912.80
5.3.280.0180.09312.71
5.3.270.0070.07112.72
5.3.260.0100.09412.72
5.3.250.0150.07212.72
5.3.240.0090.08212.71
5.3.230.0100.07812.71
5.3.220.0140.07612.68
5.3.210.0080.06612.68
5.3.200.0070.06112.68
5.3.190.0090.06212.68
5.3.180.0200.09812.68
5.3.170.0140.07312.67
5.3.160.0070.06112.67
5.3.150.0090.06712.68
5.3.140.0110.07012.66
5.3.130.0260.11112.66
5.3.120.0120.08512.66
5.3.110.0160.09812.66
5.3.100.0150.07212.12
5.3.90.0130.07412.08
5.3.80.0130.07012.08
5.3.70.0160.04712.07
5.3.60.0070.04312.06
5.3.50.0070.03912.00
5.3.40.0080.03912.00
5.3.30.0070.05311.95
5.3.20.0070.05811.73
5.3.10.0170.08211.69
5.3.00.0090.04911.68
5.2.170.0080.0419.19
5.2.160.0140.0649.19
5.2.150.0060.0589.19
5.2.140.0070.0459.18
5.2.130.0110.0699.14
5.2.120.0070.0419.14
5.2.110.0050.0429.15
5.2.100.0120.0559.14
5.2.90.0050.0469.14
5.2.80.0060.0369.14
5.2.70.0060.0359.14
5.2.60.0030.0409.09
5.2.50.0060.0389.06
5.2.40.0070.0559.04
5.2.30.0150.0509.02
5.2.20.0060.0429.00
5.2.10.0090.0388.94
5.2.00.0130.0488.80
5.1.60.0140.0848.08
5.1.50.0060.0418.08
5.1.40.0080.0368.06
5.1.30.0050.0408.41
5.1.20.0100.0508.43
5.1.10.0070.0358.16
5.1.00.0070.0538.16
5.0.50.0070.0516.64
5.0.40.0090.0556.49
5.0.30.0150.0586.31
5.0.20.0040.0336.28
5.0.10.0090.0386.25
5.0.00.0060.0636.24
4.4.90.0030.0234.78
4.4.80.0050.0224.76
4.4.70.0050.0214.75
4.4.60.0070.0404.76
4.4.50.0080.0324.77
4.4.40.0080.0514.71
4.4.30.0060.0194.76
4.4.20.0050.0284.85
4.4.10.0060.0424.85
4.4.00.0110.0554.76
4.3.110.0110.0414.67
4.3.100.0070.0494.66
4.3.90.0040.0284.63
4.3.80.0100.0494.59
4.3.70.0050.0254.63
4.3.60.0080.0524.63
4.3.50.0100.0464.62
4.3.40.0080.0394.54
4.3.30.0030.0253.29
4.3.20.0090.0353.28
4.3.10.0050.0353.23
4.3.00.0130.0236.75

preferences:
43.02 ms | 401 KiB | 5 Q