3v4l.org

run code in 300+ PHP versions simultaneously
<?php function loop($array) { echo '<ol class="dd-list">'; echo "\n"; $arrayObj = new ArrayObject($array); foreach ( $iterator = $arrayObj->getIterator() as $key => $value ) { if(is_array($iterator->current())) { loop($iterator->current()); } else { if($iterator->key()=='position') { echo '<li class="dd-item" data-id="' . $iterator->current() . '">'; echo '<div class="dd-handle">' . $iterator->key() . ' ' . $iterator->current() . '</div>'; echo '</li>'; echo "\n"; } } } echo '</ol>'; } $testArray = array('1', '2', array('3', '4')); /* $arrayObj = new ArrayObject($testArray); foreach ( $iterator = $arrayObj->getIterator() as $key => $value ) { echo 'key ' . $iterator->key(); echo "\n"; echo 'current' . $iterator->current(); echo "\n"; echo "\n"; } */ loop($testArray);

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.0100.01016.48
8.3.50.0070.01321.98
8.3.40.0160.00018.54
8.3.30.0110.00719.02
8.3.20.0040.00420.34
8.3.10.0000.00823.66
8.3.00.0060.00322.39
8.2.180.0160.00616.63
8.2.170.0110.00322.96
8.2.160.0110.00422.26
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0080.00826.16
8.2.120.0040.00422.10
8.2.110.0110.00722.25
8.2.100.0040.00817.91
8.2.90.0000.00919.08
8.2.80.0040.00417.97
8.2.70.0060.00317.38
8.2.60.0000.00917.92
8.2.50.0090.00018.07
8.2.40.0030.00619.28
8.2.30.0060.00317.96
8.2.20.0000.00817.70
8.2.10.0060.00319.57
8.2.00.0040.00417.80
8.1.280.0100.00325.92
8.1.270.0040.00421.95
8.1.260.0090.00026.35
8.1.250.0080.00028.09
8.1.240.0070.00323.84
8.1.230.0060.00619.01
8.1.220.0000.00817.74
8.1.210.0000.00818.77
8.1.200.0110.00017.23
8.1.190.0040.00417.43
8.1.180.0040.00418.10
8.1.170.0030.00618.64
8.1.160.0000.00722.07
8.1.150.0000.00718.56
8.1.140.0070.00017.36
8.1.130.0030.00317.88
8.1.120.0030.00317.50
8.1.110.0080.00017.44
8.1.100.0070.00017.43
8.1.90.0050.00217.50
8.1.80.0030.00317.41
8.1.70.0030.00317.42
8.1.60.0000.00917.57
8.1.50.0000.00817.53
8.1.40.0070.00317.35
8.1.30.0040.00417.64
8.1.20.0000.00817.61
8.1.10.0000.00817.46
8.1.00.0040.00417.43
8.0.300.0040.00418.77
8.0.290.0000.00717.05
8.0.280.0050.00218.35
8.0.270.0060.00317.23
8.0.260.0000.00716.73
8.0.250.0030.00316.85
8.0.240.0000.00716.93
8.0.230.0050.00316.96
8.0.220.0030.00316.77
8.0.210.0030.00316.90
8.0.200.0040.00416.96
8.0.190.0070.00016.81
8.0.180.0070.00016.91
8.0.170.0080.00016.88
8.0.160.0040.00416.94
8.0.150.0000.00716.81
8.0.140.0080.00016.85
8.0.130.0000.00513.31
8.0.120.0000.00816.86
8.0.110.0000.00716.87
8.0.100.0070.00016.73
8.0.90.0030.00516.93
8.0.80.0130.01016.89
8.0.70.0040.00416.95
8.0.60.0000.00816.77
8.0.50.0050.00516.95
8.0.30.0100.00817.00
8.0.20.0140.00617.40
8.0.10.0070.00017.01
8.0.00.0100.01016.66
7.4.330.0030.00315.03
7.4.320.0060.00016.45
7.4.300.0000.00616.49
7.4.290.0000.00716.59
7.4.280.0030.00316.56
7.4.270.0030.00316.49
7.4.260.0070.00016.50
7.4.250.0040.00416.54
7.4.240.0020.00616.59
7.4.230.0000.00716.41
7.4.220.0120.00916.70
7.4.210.0090.00716.55
7.4.200.0000.00716.30
7.4.190.0070.00016.76
7.4.160.0140.00416.64
7.4.150.0060.01317.40
7.4.140.0110.00817.86
7.4.130.0120.00916.49
7.4.120.0110.00916.58
7.4.110.0110.00516.56
7.4.100.0140.00416.41
7.4.90.0060.01116.46
7.4.80.0150.00316.43
7.4.70.0140.00416.63
7.4.60.0030.01616.55
7.4.50.0040.00416.51
7.4.40.0060.00922.77
7.4.30.0130.00316.57
7.4.00.0040.00715.15
7.3.330.0030.00313.02
7.3.320.0030.00313.05
7.3.310.0050.00316.26
7.3.300.0030.00316.19
7.3.290.0070.00716.21
7.3.280.0120.00616.27
7.3.270.0120.00517.40
7.3.260.0160.00016.64
7.3.250.0080.01216.35
7.3.240.0110.00516.51
7.3.230.0160.00016.39
7.3.210.0130.01016.27
7.3.200.0070.01119.39
7.3.190.0060.01216.43
7.3.180.0000.01516.39
7.3.170.0120.00416.42
7.3.160.0060.00916.52
7.3.120.0070.00714.74
7.2.330.0120.00616.61
7.2.320.0090.00916.50
7.2.310.0180.00616.69
7.2.300.0060.01216.58
7.2.290.0130.01016.86
7.2.110.0050.00916.56
7.2.80.0060.00916.84
7.2.60.0030.01016.64
7.2.00.0080.00419.25
7.1.200.0030.00715.87
7.1.100.0040.00818.27
7.1.70.0030.00717.08
7.1.60.0110.01419.29
7.1.50.0100.01416.68
7.1.00.0100.07022.54
7.0.200.0030.00716.42
7.0.140.0070.06722.18
7.0.60.0200.07019.89
7.0.50.0000.09317.85
7.0.40.0130.04720.10
7.0.30.0200.07020.13
7.0.20.0230.04720.24
7.0.10.0230.05320.11
7.0.00.0230.05720.15
5.6.280.0000.07721.02
5.6.210.0100.07720.54
5.6.200.0070.03718.19
5.6.190.0070.08720.60
5.6.180.0030.06020.57
5.6.170.0130.07320.54
5.6.160.0100.08020.54
5.6.150.0030.05018.14
5.6.140.0030.05718.11
5.6.130.0070.03718.18
5.6.120.0170.03721.10
5.6.110.0170.07321.09
5.6.100.0130.07020.98
5.6.90.0100.03720.97
5.6.80.0030.04020.29
5.6.70.0230.04320.39
5.5.350.0030.08320.45
5.5.340.0070.07717.98
5.5.330.0100.06720.47
5.5.320.0070.03720.31
5.5.310.0270.07720.37
5.5.300.0000.04018.06
5.5.290.0000.04718.01
5.5.280.0070.08720.88
5.5.270.0100.08020.87
5.5.260.0070.08320.96
5.5.250.0000.08720.66
5.5.240.0070.07020.19
5.4.450.0030.03319.30
5.4.440.0830.05319.63
5.4.430.0970.03719.57
5.4.420.0670.05719.62
5.4.410.0100.05319.05
5.4.400.0030.08018.87
5.4.390.0030.06318.76
5.4.380.0100.06318.77
5.4.370.0170.05718.72
5.4.360.0330.05718.70
5.4.350.0300.06318.47
5.4.340.0100.05718.74
5.4.320.0090.03712.50
5.4.310.0100.03312.50
5.4.300.0080.04012.50
5.4.290.0080.03712.50
5.4.280.0110.07712.38
5.4.270.0150.06212.38
5.4.260.0170.09812.37
5.4.250.0160.11212.37
5.4.240.0070.06512.38
5.4.230.0070.05112.37
5.4.220.0180.06012.36
5.4.210.0070.05912.36
5.4.200.0160.08412.37
5.4.190.0160.11112.36
5.4.180.0220.11012.36
5.4.170.0160.09912.37
5.4.160.0090.06112.37
5.4.150.0070.05812.36
5.4.140.0100.06012.05
5.4.130.0070.05912.03
5.4.120.0140.05811.99
5.4.110.0110.05211.98
5.4.100.0070.05511.98
5.4.90.0110.05611.98
5.4.80.0070.06011.98
5.4.70.0120.06411.98
5.4.60.0080.07111.98
5.4.50.0040.05811.98
5.4.40.0070.05511.97
5.4.30.0100.04911.96
5.4.20.0100.05511.96
5.4.10.0050.05611.96
5.4.00.0090.07411.46
5.3.290.0090.04212.80
5.3.280.0130.10612.71
5.3.270.0150.12412.72
5.3.260.0230.11412.72
5.3.250.0210.10912.71
5.3.240.0170.11312.71
5.3.230.0270.10612.71
5.3.220.0160.07112.68
5.3.210.0060.11412.68
5.3.200.0080.05012.68
5.3.190.0100.04812.67
5.3.180.0070.05512.67
5.3.170.0070.05712.67
5.3.160.0070.05812.67
5.3.150.0120.05112.68
5.3.140.0140.05112.66
5.3.130.0090.06012.65
5.3.120.0100.05612.65
5.3.110.0050.06012.66
5.3.100.0090.05312.12
5.3.90.0120.05112.09
5.3.80.0060.05312.07
5.3.70.0080.05312.07
5.3.60.0070.05212.07
5.3.50.0070.05212.00
5.3.40.0110.04812.00
5.3.30.0070.05311.95
5.3.20.0090.04911.74
5.3.10.0090.04911.70
5.3.00.0070.05111.70
5.2.170.0070.0649.19
5.2.160.0090.0409.19
5.2.150.0090.0409.19
5.2.140.0080.0429.19
5.2.130.0050.0439.15
5.2.120.0070.0419.14
5.2.110.0060.0429.15
5.2.100.0070.0339.15
5.2.90.0100.0379.14
5.2.80.0080.0439.15
5.2.70.0070.0439.14
5.2.60.0080.0439.10
5.2.50.0090.0419.07
5.2.40.0070.0429.04
5.2.30.0070.0459.02
5.2.20.0080.0519.01
5.2.10.0080.0408.92
5.2.00.0040.0408.79
5.1.60.0080.0308.07
5.1.50.0080.0298.07
5.1.40.0030.0358.05
5.1.30.0090.0348.39
5.1.20.0060.0418.42
5.1.10.0050.0378.14
5.1.00.0070.0368.15
5.0.50.0050.0296.63
5.0.40.0060.0276.50
5.0.30.0050.0416.31
5.0.20.0050.0276.28
5.0.10.0060.0276.26
5.0.00.0060.0406.25
4.4.90.0030.0244.78
4.4.80.0040.0204.75
4.4.70.0030.0224.75
4.4.60.0040.0214.75
4.4.50.0040.0214.77
4.4.40.0060.0314.71
4.4.30.0040.0204.76
4.4.20.0010.0244.84
4.4.10.0020.0234.85
4.4.00.0060.0294.76
4.3.110.0030.0234.67
4.3.100.0050.0204.67
4.3.90.0080.0164.64
4.3.80.0050.0304.59
4.3.70.0060.0194.63
4.3.60.0040.0214.62
4.3.50.0060.0204.63
4.3.40.0080.0294.54
4.3.30.0030.0253.30
4.3.20.0060.0213.28
4.3.10.0060.0203.25
4.3.00.0070.02713.64

preferences:
40.49 ms | 401 KiB | 5 Q