3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A implements IteratorAggregate{ public function getIterator(){ return new B(); } } class B implements IteratorAggregate{ public function getIterator(){ return new ArrayIterator(array(1, 2, 3, 4, 5)); } } $a = new A(); foreach ($a as $aa){ echo $aa; }

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.70.0040.01116.73
8.3.60.0170.00316.88
8.3.50.0130.00522.12
8.3.40.0110.00418.71
8.3.30.0070.01419.10
8.3.20.0080.00020.29
8.3.10.0040.00423.49
8.3.00.0050.00319.11
8.2.180.0110.00416.50
8.2.170.0150.00622.96
8.2.160.0070.00720.39
8.2.150.0000.00824.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0050.00320.79
8.2.110.0030.00620.99
8.2.100.0060.00617.84
8.2.90.0060.00319.13
8.2.80.0000.00817.97
8.2.70.0060.00317.63
8.2.60.0060.00317.93
8.2.50.0000.00918.07
8.2.40.0080.00021.08
8.2.30.0000.00818.15
8.2.20.0090.00017.68
8.2.10.0000.00718.05
8.2.00.0000.00817.55
8.1.280.0140.00725.92
8.1.270.0030.00623.90
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0090.00022.12
8.1.230.0040.00720.64
8.1.220.0080.00017.74
8.1.210.0030.00518.77
8.1.200.0060.00317.35
8.1.190.0040.00417.23
8.1.180.0060.00318.10
8.1.170.0080.00018.26
8.1.160.0040.00422.05
8.1.150.0000.00718.57
8.1.140.0000.00717.35
8.1.130.0030.00317.77
8.1.120.0000.00817.46
8.1.110.0000.00717.48
8.1.100.0030.00517.48
8.1.90.0030.00517.42
8.1.80.0000.00717.33
8.1.70.0000.00717.41
8.1.60.0000.00917.48
8.1.50.0000.00917.50
8.1.40.0000.00917.47
8.1.30.0060.00317.56
8.1.20.0020.00517.47
8.1.10.0000.00817.54
8.1.00.0080.00017.51
8.0.300.0000.00718.77
8.0.290.0000.00716.75
8.0.280.0000.00718.48
8.0.270.0000.00717.16
8.0.260.0060.00017.26
8.0.250.0000.00716.90
8.0.240.0030.00316.94
8.0.230.0040.00416.91
8.0.220.0030.00316.94
8.0.210.0030.00316.88
8.0.200.0040.00416.96
8.0.190.0030.00316.97
8.0.180.0000.00716.80
8.0.170.0000.00817.00
8.0.160.0030.00516.83
8.0.150.0000.00716.86
8.0.140.0000.00716.81
8.0.130.0090.00013.25
8.0.120.0030.00516.77
8.0.110.0050.00316.91
8.0.100.0000.00716.77
8.0.90.0030.00516.92
8.0.80.0100.00716.93
8.0.70.0030.00516.75
8.0.60.0000.00716.86
8.0.50.0050.00316.71
8.0.30.0070.01417.03
8.0.20.0090.01117.41
8.0.10.0040.00416.95
8.0.00.0140.00716.66
7.4.330.0060.00015.00
7.4.320.0030.00316.50
7.4.300.0030.00316.56
7.4.290.0060.00516.48
7.4.280.0030.00316.61
7.4.270.0000.00816.58
7.4.260.0060.00316.46
7.4.250.0000.00716.51
7.4.240.0020.00516.57
7.4.230.0020.00516.57
7.4.220.0130.00716.46
7.4.210.0050.01116.54
7.4.200.0080.00016.63
7.4.190.0030.00316.63
7.4.160.0000.01516.32
7.4.150.0040.01417.40
7.4.140.0100.00617.86
7.4.130.0070.01016.49
7.4.120.0100.00916.58
7.4.110.0100.00716.29
7.4.100.0090.00916.43
7.4.90.0130.00316.39
7.4.80.0000.01619.39
7.4.70.0090.00616.45
7.4.60.0060.01116.40
7.4.50.0050.00016.53
7.4.40.0130.00316.60
7.4.30.0080.01016.47
7.4.00.0030.01014.98
7.3.330.0020.00313.33
7.3.320.0050.00013.16
7.3.310.0070.00016.29
7.3.300.0000.00716.26
7.3.290.0070.01316.29
7.3.280.0110.00916.28
7.3.270.0100.01017.40
7.3.260.0170.00616.34
7.3.250.0130.00716.48
7.3.240.0070.01116.22
7.3.230.0140.00316.62
7.3.210.0070.01116.38
7.3.200.0100.00719.39
7.3.190.0100.01216.57
7.3.180.0100.00716.45
7.3.170.0110.00516.28
7.3.160.0060.00916.27
7.3.120.0030.01014.74
7.2.330.0030.01416.61
7.2.320.0040.01916.75
7.2.310.0150.00416.70
7.2.300.0110.00716.64
7.2.290.0090.00916.85
7.2.60.0030.01016.73
7.2.00.0000.01319.31
7.1.200.0040.00715.56
7.1.100.0060.00318.22
7.1.70.0030.00617.03
7.1.60.0140.00319.46
7.1.50.0070.01316.90
7.1.00.0030.07722.41
7.0.200.0000.00816.88
7.0.140.0030.07321.95
7.0.60.0100.04019.94
7.0.50.0000.06717.90
7.0.40.0130.05720.18
7.0.30.0430.04720.09
7.0.20.0270.04320.30
7.0.10.0200.04020.16
7.0.00.0130.08020.07
5.6.280.0070.06721.00
5.6.210.0070.08720.64
5.6.200.0000.05018.14
5.6.190.0070.09020.42
5.6.180.3700.04020.61
5.6.170.0170.04720.56
5.6.160.0070.05320.71
5.6.150.0070.07318.14
5.6.140.0000.08018.18
5.6.130.0100.08018.19
5.6.120.0130.07021.01
5.6.110.0070.08721.09
5.6.100.0130.08021.00
5.6.90.0030.08721.03
5.6.80.0070.07720.38
5.6.70.0270.07020.50
5.5.350.0200.07320.32
5.5.340.0130.07318.02
5.5.330.0070.04020.13
5.5.320.0230.06720.34
5.5.310.0270.04020.50
5.5.300.0030.04318.08
5.5.290.0130.05317.98
5.5.280.0200.05720.66
5.5.270.0070.06020.95
5.5.260.0100.08020.96
5.5.250.0070.08020.71
5.5.240.0100.08020.19
5.4.450.0800.06019.48
5.4.440.0830.04719.58
5.4.430.0800.05319.48
5.4.420.0630.00019.39
5.4.410.0130.05319.03
5.4.400.0330.04018.79
5.4.390.0400.05318.80
5.4.380.0170.05718.59
5.4.370.0370.04718.53
5.4.360.0100.05018.53
5.4.350.0060.03612.02
5.4.340.0060.04812.02
5.4.320.0080.05312.50
5.4.310.0110.04512.50
5.4.300.0110.04812.50
5.4.290.0130.05012.49
5.4.280.0120.04812.39
5.4.270.0200.07812.40
5.4.260.0140.04912.39
5.4.250.0110.05212.39
5.4.240.0080.05012.39
5.4.230.0110.05512.39
5.4.220.0050.05612.39
5.4.210.0110.05112.39
5.4.200.0100.05112.39
5.4.190.0080.05312.38
5.4.180.0070.05112.38
5.4.170.0100.05412.39
5.4.160.0170.04212.39
5.4.150.0120.09412.38
5.4.140.0140.06312.07
5.4.130.0090.05612.06
5.4.120.0220.09612.01
5.4.110.0120.04812.01
5.4.100.0100.04712.02
5.4.90.0130.04812.01
5.4.80.0100.05412.02
5.4.70.0100.04712.01
5.4.60.0140.05912.01
5.4.50.0120.04712.01
5.4.40.0190.06311.99
5.4.30.0170.05211.99
5.4.20.0110.05911.99
5.4.10.0080.05012.00
5.4.00.0090.05511.48
5.3.290.0080.04312.80
5.3.280.0100.05212.71
5.3.270.0120.06412.73
5.3.260.0160.08412.72
5.3.250.0150.08912.72
5.3.240.0140.10812.72
5.3.230.0150.06312.71
5.3.220.0060.06412.68
5.3.210.0230.08912.68
5.3.200.0150.07012.68
5.3.190.0130.08012.68
5.3.180.0150.04912.67
5.3.170.0080.06012.67
5.3.160.0080.06112.68
5.3.150.0100.05412.67
5.3.140.0080.05512.66
5.3.130.0060.05612.66
5.3.120.0180.04712.66
5.3.110.0120.04912.66
5.3.100.0070.04412.12
5.3.90.0050.04412.10
5.3.80.0070.04512.09
5.3.70.0110.03712.10
5.3.60.0090.04012.08
5.3.50.0100.04112.03
5.3.40.0100.04812.03
5.3.30.0110.04811.98
5.3.20.0130.04411.77
5.3.10.0070.05411.73
5.3.00.0180.08111.72
5.2.170.0070.0459.23
5.2.160.0130.0639.23
5.2.150.0110.0739.22
5.2.140.0090.0799.22
5.2.130.0130.0829.18
5.2.120.0280.0949.18
5.2.110.0050.0419.19
5.2.100.0080.0359.19
5.2.90.0080.1009.19
5.2.80.0070.0369.18
5.2.70.0030.0359.18
5.2.60.0090.0549.13
5.2.50.0100.0459.10
5.2.40.0080.0439.08
5.2.30.0100.0589.05
5.2.20.0090.0669.04
5.2.10.0150.0608.95
5.2.00.0150.0588.82
5.1.60.0150.0588.09
5.1.50.0200.0548.09
5.1.40.0130.0598.07
5.1.30.0070.0548.42
5.1.20.0140.0468.45
5.1.10.0040.0458.17
5.1.00.0130.0348.16
5.0.50.0140.0466.64
5.0.40.0110.0456.50
5.0.30.0220.0876.32
5.0.20.0100.0366.28
5.0.10.0080.0436.26
5.0.00.0230.0916.25
4.4.90.0090.0414.78
4.4.80.0060.0224.75
4.4.70.0170.0364.75
4.4.60.0090.0364.75
4.4.50.0150.0344.77
4.4.40.0020.0324.71
4.4.30.0020.0254.76
4.4.20.0050.0364.85
4.4.10.0060.0464.84
4.4.00.0070.0554.76
4.3.110.0070.0284.67
4.3.100.0040.0454.66
4.3.90.0080.0324.63
4.3.80.0050.0494.58
4.3.70.0090.0334.63
4.3.60.0060.0384.63
4.3.50.0140.0504.63
4.3.40.0070.0684.54
4.3.30.0050.0363.30
4.3.20.0110.0313.28
4.3.10.0090.0383.24
4.3.00.0070.0207.61

preferences:
41.6 ms | 401 KiB | 5 Q