3v4l.org

run code in 300+ PHP versions simultaneously
<?php $myArray = array( 0, array( 0, 1, array( 0, 1, 2, array( 0, 1, 2, 3, array("the end") ) ) ) ); $recursive_array_iterator = new RecursiveArrayIterator($myArray); iterator_apply($recursive_array_iterator, 'traverseRecursiveArray', array($recursive_array_iterator)); function traverseRecursiveArray($iterator) { $i = 0; 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("<pre>" . $myArray . "</pre>");

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.0140.00318.52
8.3.50.0090.01122.09
8.3.40.0110.00718.84
8.3.30.0080.00618.92
8.3.20.0050.00220.34
8.3.10.0080.00021.78
8.3.00.0060.00317.80
8.2.180.0180.00016.63
8.2.170.0160.00022.96
8.2.160.0070.00720.35
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0090.00021.09
8.2.110.0030.00920.96
8.2.100.0100.00317.97
8.2.90.0030.00519.35
8.2.80.0040.00417.97
8.2.70.0040.00417.63
8.2.60.0080.00017.93
8.2.50.0060.00318.10
8.2.40.0080.00019.89
8.2.30.0000.00718.39
8.2.20.0080.00017.79
8.2.10.0000.00818.27
8.2.00.0040.00417.77
8.1.280.0070.01425.92
8.1.270.0040.00423.96
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00322.70
8.1.230.0060.00617.77
8.1.220.0040.00417.74
8.1.210.0060.00318.77
8.1.200.0060.00317.22
8.1.190.0000.00917.22
8.1.180.0000.00818.10
8.1.170.0000.00818.59
8.1.160.0070.00022.01
8.1.150.0070.00018.96
8.1.140.0000.00817.49
8.1.130.0070.00017.93
8.1.120.0030.00517.52
8.1.110.0000.00717.48
8.1.100.0020.00517.39
8.1.90.0000.00717.50
8.1.80.0050.00317.38
8.1.70.0000.00717.39
8.1.60.0000.00917.65
8.1.50.0060.00317.48
8.1.40.0000.00817.55
8.1.30.0040.00417.59
8.1.20.0080.00017.67
8.1.10.0030.00517.67
8.1.00.0030.00517.44
8.0.300.0020.00518.77
8.0.290.0080.00016.75
8.0.280.0070.00018.39
8.0.270.0040.00416.93
8.0.260.0030.00317.28
8.0.250.0030.00317.02
8.0.240.0040.00417.05
8.0.230.0030.00317.05
8.0.220.0070.00016.94
8.0.210.0040.00417.00
8.0.200.0050.00217.04
8.0.190.0030.00317.04
8.0.180.0070.00017.06
8.0.170.0030.00616.98
8.0.160.0050.00317.05
8.0.150.0040.00416.86
8.0.140.0050.00216.98
8.0.130.0000.00613.46
8.0.120.0040.00416.88
8.0.110.0000.00716.88
8.0.100.0070.00016.85
8.0.90.0000.00717.03
8.0.80.0070.01016.98
8.0.70.0040.00417.06
8.0.60.0080.00016.88
8.0.50.0080.00017.02
8.0.30.0080.01417.09
8.0.20.0120.00817.40
8.0.10.0000.00817.10
8.0.00.0120.00516.89
7.4.330.0000.00515.00
7.4.320.0070.00016.56
7.4.300.0000.00716.58
7.4.290.0000.00716.56
7.4.280.0040.00416.55
7.4.270.0000.00716.66
7.4.260.0030.00316.62
7.4.250.0040.00416.45
7.4.240.0030.00416.56
7.4.230.0000.00716.71
7.4.220.0040.01516.40
7.4.210.0030.01216.64
7.4.200.0000.00816.40
7.4.160.0100.00716.47
7.4.150.0040.01517.40
7.4.140.0110.00617.86
7.4.130.0090.00816.55
7.4.120.0100.00716.65
7.4.110.0060.01216.65
7.4.100.0070.01016.62
7.4.90.0090.00916.56
7.4.80.0110.01119.39
7.4.70.0060.01716.57
7.4.60.0140.01016.48
7.4.50.0030.00616.28
7.4.40.0130.00316.46
7.4.30.0160.00016.53
7.4.00.0040.00715.27
7.3.330.0050.00013.33
7.3.320.0060.00013.40
7.3.310.0000.00716.51
7.3.300.0070.00016.34
7.3.290.0080.01216.42
7.3.280.0060.01216.46
7.3.270.0140.00317.40
7.3.260.0160.00916.69
7.3.250.0130.00616.51
7.3.240.0140.00416.54
7.3.230.0070.01416.45
7.3.210.0000.01716.49
7.3.200.0160.01119.39
7.3.190.0100.00716.48
7.3.180.0090.00916.43
7.3.170.0100.00716.61
7.3.160.0090.01216.35
7.3.120.0080.00814.94
7.2.330.0130.01316.86
7.2.320.0040.01316.61
7.2.310.0030.01716.75
7.2.300.0100.00716.75
7.2.290.0130.00316.45
7.2.00.0000.01419.27
7.1.100.0030.01018.05
7.1.70.0030.00317.02
7.1.60.0040.02119.70
7.1.50.0100.00717.07
7.1.00.0000.07722.51
7.0.200.0040.00416.69
7.0.140.0030.07722.12
7.0.60.0100.04319.79
7.0.50.0070.07717.92
7.0.40.0070.04020.08
7.0.30.0270.05020.12
7.0.20.0230.03320.16
7.0.10.0100.08320.10
7.0.00.0070.05020.16
5.6.280.0030.07320.90
5.6.210.0030.05320.71
5.6.200.0030.08018.18
5.6.190.0030.04320.58
5.6.180.4000.04020.40
5.6.170.0470.05720.54
5.6.160.0100.05020.45
5.6.150.0130.06718.15
5.6.140.0130.03318.14
5.6.130.0070.08318.25
5.6.120.0200.07021.02
5.6.110.0100.07021.14
5.6.100.0070.04021.09
5.6.90.0000.06721.11
5.6.80.0130.07720.36
5.6.70.0400.06320.37
5.5.350.0300.07320.47
5.5.340.0130.06318.05
5.5.330.0130.07020.13
5.5.320.0270.07720.31
5.5.310.0400.06720.34
5.5.300.0030.03718.05
5.5.290.0030.06017.96
5.5.280.0030.05720.89
5.5.270.0200.07020.96
5.5.260.0130.04320.97
5.5.250.0130.03720.67
5.5.240.0270.05720.08
5.4.450.0630.05019.46
5.4.440.0830.06319.19
5.4.430.0100.05719.55
5.4.420.0170.05019.54
5.4.410.0100.05319.08
5.4.400.0000.06318.82
5.4.390.0030.06018.52
5.4.380.0200.05318.48
5.4.370.0100.05018.77
5.4.360.0170.03018.75
5.4.350.0060.03612.03
5.4.340.0040.03812.03
5.4.320.0090.03912.51
5.4.310.0070.03612.50
5.4.300.0110.03212.51
5.4.290.0030.04112.51
5.4.280.0070.03712.41
5.4.270.0080.03512.40
5.4.260.0070.03612.40
5.4.250.0080.03512.41
5.4.240.0060.03612.41
5.4.230.0060.03712.39
5.4.220.0090.03312.39
5.4.210.0040.03812.39
5.4.200.0020.04212.39
5.4.190.0060.04512.39
5.4.180.0090.03312.40
5.4.170.0090.03312.41
5.4.160.0080.03412.40
5.4.150.0100.03312.39
5.4.140.0100.04012.08
5.4.130.0080.03512.07
5.4.120.0060.03712.03
5.4.110.0090.03212.02
5.4.100.0030.03812.02
5.4.90.0030.03912.02
5.4.80.0040.03912.02
5.4.70.0090.03212.02
5.4.60.0060.03512.02
5.4.50.0070.03512.02
5.4.40.0070.03412.00
5.4.30.0040.03812.00
5.4.20.0080.03312.00
5.4.10.0020.03812.00
5.4.00.0060.03611.49
5.3.290.0070.03912.80
5.3.280.0070.03612.71
5.3.270.0060.04512.72
5.3.260.0070.03912.72
5.3.250.0040.04412.72
5.3.240.0060.03812.72
5.3.230.0060.03812.71
5.3.220.0070.04112.68
5.3.210.0090.04212.68
5.3.200.0060.04312.68
5.3.190.0090.03812.68
5.3.180.0050.03812.68
5.3.170.0060.03712.67
5.3.160.0070.03712.68
5.3.150.0070.03812.68
5.3.140.0070.04312.66
5.3.130.0050.04112.66
5.3.120.0070.03812.65
5.3.110.0070.03812.66
5.3.100.0050.03812.13
5.3.90.0070.03612.11
5.3.80.0100.03312.10
5.3.70.0060.03612.10
5.3.60.0030.04012.09
5.3.50.0060.03712.03
5.3.40.0070.03712.03
5.3.30.0050.03811.99
5.3.20.0080.04111.77
5.3.10.0040.03711.73
5.3.00.0050.03611.73
5.2.170.0060.0309.22
5.2.160.0050.0309.22
5.2.150.0030.0339.22
5.2.140.0060.0309.22
5.2.130.0010.0329.18
5.2.120.0030.0309.18
5.2.110.0050.0299.19
5.2.100.0050.0289.19
5.2.90.0090.0329.18
5.2.80.0030.0339.18
5.2.70.0060.0299.18
5.2.60.0070.0409.14
5.2.50.0090.0379.11
5.2.40.0040.0339.09
5.2.30.0080.0269.06
5.2.20.0070.0309.05
5.2.10.0080.0308.95
5.2.00.0050.0298.82
5.1.60.0050.0248.09
5.1.50.0050.0248.09
5.1.40.0060.0228.08
5.1.30.0060.0248.43
5.1.20.0050.0268.45
5.1.10.0030.0288.17
5.1.00.0030.0268.17
5.0.50.0030.0216.65
5.0.40.0040.0196.51
5.0.30.0040.0316.32
5.0.20.0040.0196.29
5.0.10.0060.0176.27
5.0.00.0000.0346.26
4.4.90.0030.0154.78
4.4.80.0020.0164.75
4.4.70.0030.0154.76
4.4.60.0000.0194.76
4.4.50.0020.0164.77
4.4.40.0020.0264.71
4.4.30.0040.0144.76
4.4.20.0010.0174.85
4.4.10.0020.0174.85
4.4.00.0020.0264.76
4.3.110.0010.0184.67
4.3.100.0060.0134.67
4.3.90.0020.0164.63
4.3.80.0010.0264.58
4.3.70.0030.0144.63
4.3.60.0040.0134.63
4.3.50.0010.0184.63
4.3.40.0050.0214.54
4.3.30.0010.0173.31
4.3.20.0010.0173.29
4.3.10.0010.0173.24
4.3.00.0100.0207.15

preferences:
46.72 ms | 401 KiB | 5 Q