3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myArray = array( "a", array( "a", "b", array( "a", "b", "c", array( "a", "b", "c", "d", array("the end") ) ) ) ); $recursive_array_iterator = new RecursiveArrayIterator($myArray); iterator_apply($recursive_array_iterator, 'traverseRecursiveArray', array($recursive_array_iterator)); function traverseRecursiveArray($iterator) { while ($iterator->valid()) { if ($iterator->hasChildren()) { traverseRecursiveArray($iterator->getChildren()); } else { $iterator->offsetSet($iterator->key(), manipulate($iterator->current())); echo $iterator->key() . ' => ' . $iterator->current() . PHP_EOL; } $iterator->next(); } } function manipulate($string) { $string .= " appended"; return $string; } var_dump(iterator_to_array($myArray, 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.0070.01416.50
8.3.50.0170.00722.06
8.3.40.0090.00618.83
8.3.30.0110.00319.21
8.3.20.0040.00420.21
8.3.10.0050.00321.94
8.3.00.0050.00318.04
8.2.180.0120.00616.63
8.2.170.0210.00022.96
8.2.160.0070.00720.44
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0040.00420.95
8.2.110.0040.00719.13
8.2.100.0070.00317.91
8.2.90.0050.00519.35
8.2.80.0090.00017.97
8.2.70.0000.00917.63
8.2.60.0060.00317.80
8.2.50.0030.00618.07
8.2.40.0040.00418.34
8.2.30.0040.00418.22
8.2.20.0060.00317.76
8.2.10.0040.00418.21
8.2.00.0000.00817.73
8.1.280.0090.00625.92
8.1.270.0090.00023.85
8.1.260.0080.00026.35
8.1.250.0090.00028.09
8.1.240.0060.00321.01
8.1.230.0090.00317.42
8.1.220.0050.00317.78
8.1.210.0000.00818.77
8.1.200.0090.00017.48
8.1.190.0000.00917.23
8.1.180.0040.00418.10
8.1.170.0060.00318.66
8.1.160.0040.00421.97
8.1.150.0000.00818.79
8.1.140.0050.00217.48
8.1.130.0050.00217.87
8.1.120.0070.00017.45
8.1.110.0000.00717.40
8.1.100.0000.00717.53
8.1.90.0000.00717.37
8.1.80.0030.00517.39
8.1.70.0040.00417.43
8.1.60.0040.00417.56
8.1.50.0080.00017.61
8.1.40.0000.00817.55
8.1.30.0060.00317.67
8.1.20.0000.00817.70
8.1.10.0040.00417.63
8.1.00.0030.00617.38
8.0.300.0070.00418.77
8.0.290.0050.00316.88
8.0.280.0030.00318.48
8.0.270.0000.00717.29
8.0.260.0000.00917.32
8.0.250.0030.00317.04
8.0.240.0070.00016.95
8.0.230.0070.00017.06
8.0.220.0030.00316.92
8.0.210.0000.00716.96
8.0.200.0040.00416.94
8.0.190.0040.00417.02
8.0.180.0030.00517.07
8.0.170.0000.00816.90
8.0.160.0030.00516.88
8.0.150.0040.00416.98
8.0.140.0000.00716.90
8.0.130.0030.00313.48
8.0.120.0030.00717.00
8.0.110.0080.00016.99
8.0.100.0040.00417.05
8.0.90.0000.00716.86
8.0.80.0130.00317.05
8.0.70.0040.00416.94
8.0.60.0000.00717.06
8.0.50.0040.00416.84
8.0.30.0100.00917.22
8.0.20.0120.00717.40
8.0.10.0000.00817.13
8.0.00.0050.01116.77
7.4.330.0000.00515.08
7.4.320.0000.00616.50
7.4.300.0000.00616.56
7.4.290.0000.00716.49
7.4.280.0070.00016.63
7.4.270.0030.00316.47
7.4.260.0060.00316.61
7.4.250.0040.00416.55
7.4.240.0030.00316.66
7.4.230.0000.00716.43
7.4.220.0100.00716.74
7.4.210.0000.02016.50
7.4.200.0080.00016.53
7.4.160.0090.01316.66
7.4.150.0090.00917.40
7.4.140.0020.01617.86
7.4.130.0100.00616.70
7.4.120.0060.01116.52
7.4.110.0030.01316.32
7.4.100.0090.00916.50
7.4.90.0070.01016.50
7.4.80.0140.01119.39
7.4.70.0110.00516.54
7.4.60.0030.01416.67
7.4.50.0040.00416.58
7.4.40.0100.00716.49
7.4.30.0060.01016.58
7.4.00.0130.00314.77
7.3.330.0000.00513.32
7.3.320.0000.00613.16
7.3.310.0070.00016.50
7.3.300.0040.00416.27
7.3.290.0100.00316.45
7.3.280.0110.00916.43
7.3.270.0090.00917.40
7.3.260.0130.00616.57
7.3.250.0080.00816.60
7.3.240.0090.00916.43
7.3.230.0030.01616.51
7.3.210.0040.01516.50
7.3.200.0120.00619.39
7.3.190.0080.01116.53
7.3.180.0110.01116.55
7.3.170.0190.00316.45
7.3.160.0130.00316.37
7.3.120.0060.01215.02
7.2.330.0060.01316.49
7.2.320.0070.01016.49
7.2.310.0130.01016.82
7.2.300.0070.01016.76
7.2.290.0110.00616.81
7.2.60.0060.00916.84
7.2.00.0060.00919.54
7.1.200.0080.00415.95
7.1.100.0060.00617.71
7.1.70.0000.00717.12
7.1.60.0070.01419.70
7.1.50.0130.01017.07
7.1.00.0030.07722.44
7.0.200.0030.00616.85
7.0.140.0100.07022.08
7.0.60.0170.07020.09
7.0.50.0130.07317.98
7.0.40.0030.08020.02
7.0.30.0330.08020.06
7.0.20.0300.08720.21
7.0.10.0000.04720.10
7.0.00.0130.05720.25
5.6.280.0000.07721.08
5.6.210.0130.07720.73
5.6.200.0070.03718.23
5.6.190.0100.05720.57
5.6.180.0230.05320.34
5.6.170.0300.07020.50
5.6.160.0000.04320.55
5.6.150.0070.03718.29
5.6.140.0030.05718.14
5.6.130.0130.06318.12
5.6.120.0100.08020.98
5.6.110.0100.07721.04
5.6.100.0030.04020.98
5.6.90.0100.06020.98
5.6.80.0070.03720.43
5.5.350.0200.05320.50
5.5.340.0070.07717.95
5.5.330.0070.07720.42
5.5.320.0200.07020.38
5.5.310.0300.06320.36
5.5.300.0100.06718.09
5.5.290.0070.04317.98
5.5.280.0070.08720.77
5.5.270.0100.07320.90
5.5.260.0000.09020.98
5.5.250.0100.07720.80
5.5.240.0100.07720.27
5.4.450.0530.06319.39
5.4.440.0100.06019.70
5.4.430.0270.04319.45
5.4.420.0170.05019.57
5.4.410.0030.06018.73
5.4.400.0430.05718.73
5.4.390.0370.04718.77
5.4.380.0070.05018.75
5.4.370.0000.04318.77
5.4.360.0130.03018.79
5.4.350.0080.03312.04
5.4.340.0070.03412.03
5.4.320.0040.03812.52
5.4.310.0070.03812.51
5.4.300.0080.04812.52
5.4.290.0060.05012.51
5.4.280.0060.03712.41
5.4.270.0080.03412.40
5.4.260.0040.04012.41
5.4.250.0060.03912.41
5.4.240.0140.06612.41
5.4.230.0070.04512.41
5.4.220.0070.03612.40
5.4.210.0060.03712.40
5.4.200.0050.03912.40
5.4.190.0050.03712.39
5.4.180.0030.03912.40
5.4.170.0030.04012.41
5.4.160.0120.04512.40
5.4.150.0150.04112.40
5.4.140.0080.04912.09
5.4.130.0100.04712.07
5.4.120.0090.03912.03
5.4.110.0090.03512.02
5.4.100.0070.03612.02
5.4.90.0080.03712.02
5.4.80.0080.03512.02
5.4.70.0080.03712.02
5.4.60.0050.04112.02
5.4.50.0090.03412.02
5.4.40.0070.03612.01
5.4.30.0050.03712.00
5.4.20.0070.03412.01
5.4.10.0050.03612.01
5.4.00.0080.03511.50
5.3.290.0080.04712.80
5.3.280.0040.04112.71
5.3.270.0090.04612.72
5.3.260.0090.04512.72
5.3.250.0130.03112.72
5.3.240.0060.04112.72
5.3.230.0070.03712.71
5.3.220.0080.04212.68
5.3.210.0120.03912.68
5.3.200.0090.03912.68
5.3.190.0030.04212.68
5.3.180.0070.03612.68
5.3.170.0040.04812.67
5.3.160.0080.04112.67
5.3.150.0100.03912.67
5.3.140.0050.04212.66
5.3.130.0070.04312.66
5.3.120.0080.03912.66
5.3.110.0120.04712.65
5.3.100.0100.04712.13
5.3.90.0080.05012.11
5.3.80.0060.04212.11
5.3.70.0080.03612.11
5.3.60.0070.03712.09
5.3.50.0050.03812.04
5.3.40.0090.03512.04
5.3.30.0070.03811.99
5.3.20.0080.04611.77
5.3.10.0150.04111.74
5.3.00.0100.05511.73
5.2.170.0030.0329.23
5.2.160.0100.0249.23
5.2.150.0060.0309.23
5.2.140.0070.0339.23
5.2.130.0030.0319.19
5.2.120.0040.0389.19
5.2.110.0050.0359.19
5.2.100.0050.0319.19
5.2.90.0040.0389.19
5.2.80.0110.0389.19
5.2.70.0110.0369.18
5.2.60.0120.0359.14
5.2.50.0100.0379.11
5.2.40.0080.0369.09
5.2.30.0070.0299.06
5.2.20.0080.0289.05
5.2.10.0030.0348.96
5.2.00.0030.0348.82
5.1.60.0080.0228.09
5.1.50.0090.0218.09
5.1.40.0040.0268.07
5.1.30.0150.0258.43
5.1.20.0030.0328.45
5.1.10.0050.0268.17
5.1.00.0080.0268.18
5.0.50.0010.0316.65
5.0.40.0050.0226.51
5.0.30.0050.0316.32
5.0.20.0030.0226.29
5.0.10.0070.0186.27
5.0.00.0020.0346.26
4.4.90.0070.0174.78
4.4.80.0050.0204.75
4.4.70.0060.0184.75
4.4.60.0060.0184.76
4.4.50.0040.0174.77
4.4.40.0040.0264.71
4.4.30.0060.0184.76
4.4.20.0060.0174.85
4.4.10.0040.0204.85
4.4.00.0040.0254.76
4.3.110.0030.0164.67
4.3.100.0040.0154.67
4.3.90.0030.0144.64
4.3.80.0020.0264.59
4.3.70.0020.0154.63
4.3.60.0020.0164.63
4.3.50.0020.0184.63
4.3.40.0010.0264.54
4.3.30.0020.0163.31
4.3.20.0040.0153.29
4.3.10.0010.0173.24
4.3.00.0100.0237.27

preferences:
52.1 ms | 401 KiB | 5 Q