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($myArray);

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.4.10.0080.00017.54
8.3.140.0030.00719.20
8.3.130.0060.00318.47
8.3.120.0130.00618.86
8.3.110.0060.00320.94
8.3.100.0030.00618.32
8.3.90.0160.00326.77
8.3.80.0060.00316.50
8.3.70.0000.01416.58
8.3.60.0130.00416.75
8.3.50.0190.00621.97
8.3.40.0120.00318.67
8.3.30.0110.00419.01
8.3.20.0000.00820.29
8.3.10.0030.00521.57
8.3.00.0000.00817.93
8.2.250.0170.00316.73
8.2.240.0030.00617.39
8.2.230.0120.00322.58
8.2.220.0070.00424.06
8.2.210.0120.00926.77
8.2.200.0040.00416.75
8.2.190.0040.01116.75
8.2.180.0060.00925.92
8.2.170.0060.00918.95
8.2.160.0070.01122.96
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0000.00820.98
8.2.110.0030.00719.31
8.2.100.0060.00618.16
8.2.90.0000.00819.35
8.2.80.0050.00317.97
8.2.70.0050.00317.63
8.2.60.0000.00817.75
8.2.50.0040.00417.59
8.2.40.0040.00419.47
8.2.30.0080.00018.34
8.2.20.0070.00017.83
8.2.10.0060.00318.02
8.2.00.0000.00817.69
8.1.300.0040.00418.51
8.1.290.0060.00330.84
8.1.280.0120.00925.92
8.1.270.0040.00423.96
8.1.260.0040.00426.35
8.1.250.0090.00028.09
8.1.240.0070.00323.92
8.1.230.0090.00317.64
8.1.220.0000.00717.77
8.1.210.0040.00418.77
8.1.200.0030.00617.35
8.1.190.0080.00017.34
8.1.180.0040.00418.10
8.1.170.0040.00417.65
8.1.160.0000.00721.91
8.1.150.0000.00718.90
8.1.140.0050.00317.33
8.1.130.0000.00717.91
8.1.120.0000.00717.50
8.1.110.0000.00817.47
8.1.100.0000.00717.49
8.1.90.0040.00417.50
8.1.80.0000.00817.48
8.1.70.0000.00717.39
8.1.60.0030.00617.65
8.1.50.0040.00417.52
8.1.40.0080.00017.51
8.1.30.0000.00917.59
8.1.20.0040.00417.72
8.1.10.0000.00817.50
8.1.00.0080.00017.42
8.0.300.0040.00418.77
8.0.290.0000.01016.75
8.0.280.0000.00818.52
8.0.270.0030.00317.27
8.0.260.0040.00417.25
8.0.250.0050.00216.89
8.0.240.0000.00717.02
8.0.230.0000.00716.89
8.0.220.0000.00716.92
8.0.210.0070.00016.89
8.0.200.0040.00416.86
8.0.190.0000.00717.00
8.0.180.0030.00517.00
8.0.170.0030.00516.94
8.0.160.0000.00716.86
8.0.150.0040.00416.89
8.0.140.0040.00416.83
8.0.130.0030.00313.36
8.0.120.0050.00316.90
8.0.110.0040.00416.88
8.0.100.0040.00416.83
8.0.90.0030.00516.82
8.0.80.0060.00916.81
8.0.70.0070.00016.72
8.0.60.0000.00716.82
8.0.50.0040.00416.80
8.0.30.0120.00817.21
8.0.20.0120.00717.40
8.0.10.0050.00317.04
8.0.00.0120.00616.84
7.4.330.0000.00615.00
7.4.320.0080.00016.62
7.4.300.0030.00316.43
7.4.290.0070.00016.59
7.4.280.0040.00416.41
7.4.270.0000.00816.62
7.4.260.0000.01116.64
7.4.250.0040.00416.59
7.4.240.0040.00316.56
7.4.230.0070.00016.42
7.4.220.0070.01116.55
7.4.210.0140.00616.63
7.4.200.0070.00016.42
7.4.160.0130.00916.55
7.4.150.0110.00817.40
7.4.140.0100.00817.86
7.4.130.0080.00816.51
7.4.120.0100.00716.56
7.4.110.0090.00916.53
7.4.100.0110.00716.45
7.4.90.0100.01016.59
7.4.80.0070.01419.39
7.4.70.0070.01016.38
7.4.60.0100.00616.57
7.4.50.0090.00016.57
7.4.40.0060.01016.30
7.4.30.0120.00416.61
7.4.00.0080.00815.10
7.3.330.0000.00513.29
7.3.320.0000.00513.11
7.3.310.0030.00516.30
7.3.300.0000.00716.29
7.3.290.0100.00716.30
7.3.280.0080.01116.32
7.3.270.0140.00317.40
7.3.260.0130.01316.58
7.3.250.0070.01016.55
7.3.240.0150.00416.51
7.3.230.0130.01016.52
7.3.210.0140.00416.51
7.3.200.0060.01219.39
7.3.190.0160.00316.52
7.3.180.0120.00616.48
7.3.170.0130.01016.43
7.3.160.0070.01116.48
7.3.120.0130.00314.96
7.3.110.0110.00614.99
7.3.100.0030.01314.90
7.3.90.0050.01014.77
7.3.80.0020.00914.88
7.3.70.0090.00314.78
7.3.60.0050.01014.85
7.3.50.0000.01214.63
7.3.40.0100.00314.88
7.3.30.0040.00814.62
7.3.20.0040.01416.62
7.3.10.0090.00616.58
7.3.00.0030.01016.56
7.2.330.0040.01516.79
7.2.320.0100.00816.88
7.2.310.0060.01516.83
7.2.300.0160.00616.39
7.2.290.0160.00016.67
7.2.250.0110.00714.78
7.2.240.0040.01215.10
7.2.230.0080.00715.30
7.2.220.0070.01015.12
7.2.210.0080.00414.87
7.2.200.0070.00615.21
7.2.190.0050.01014.95
7.2.180.0030.00914.85
7.2.170.0060.00815.02
7.2.160.0000.01515.02
7.2.150.0060.00617.03
7.2.140.0050.00816.96
7.2.130.0030.00817.03
7.2.120.0020.01516.95
7.2.110.0040.00916.90
7.2.100.0070.01016.91
7.2.90.0080.00817.05
7.2.80.0050.01116.95
7.2.70.0080.00616.99
7.2.60.0020.01017.04
7.2.50.0100.00617.03
7.2.40.0070.01016.94
7.2.30.0080.00816.94
7.2.20.0090.00516.85
7.2.10.0050.01016.84
7.2.00.0080.00717.81
7.1.330.0070.01015.82
7.1.320.0020.01015.74
7.1.310.0060.00615.76
7.1.300.0080.00815.85
7.1.290.0040.00815.68
7.1.280.0050.00715.84
7.1.270.0040.00715.63
7.1.260.0040.00915.82
7.1.250.0040.01015.83
7.1.240.0060.00915.77
7.1.230.0060.00315.84
7.1.220.0040.00815.70
7.1.210.0060.01015.87
7.1.200.0090.00615.62
7.1.190.0060.00615.89
7.1.180.0040.00415.81
7.1.170.0030.00515.86
7.1.160.0000.01315.82
7.1.150.0040.01115.95
7.1.140.0030.01015.95
7.1.130.0030.01015.66
7.1.120.0090.00615.46
7.1.110.0100.00315.81
7.1.100.0000.01117.04
7.1.90.0130.00015.78
7.1.80.0080.00415.86
7.1.70.0040.00416.36
7.1.60.0110.00917.66
7.1.50.0090.00716.54
7.1.40.0030.01316.04
7.1.30.0060.00915.83
7.1.20.0100.00615.90
7.1.10.0040.00815.42
7.1.00.0110.03719.10
7.0.330.0060.00915.42
7.0.320.0070.00715.43
7.0.310.0000.01715.35
7.0.300.0070.01015.61
7.0.290.0030.01015.46
7.0.280.0000.01015.33
7.0.270.0030.01015.27
7.0.260.0030.01015.38
7.0.250.0070.01015.47
7.0.240.0000.01215.28
7.0.230.0060.01015.22
7.0.220.0030.00915.34
7.0.210.0070.01015.42
7.0.200.0020.00716.01
7.0.190.0040.01215.57
7.0.180.0040.01115.29
7.0.170.0070.00715.48
7.0.160.0040.00715.59
7.0.150.0000.00815.33
7.0.140.0050.04218.76
7.0.130.0080.00615.43
7.0.120.0030.00615.59
7.0.110.0030.00915.18
7.0.100.0030.00515.46
7.0.90.0110.00415.41
7.0.80.0000.01415.58
7.0.70.0040.00815.32
7.0.60.0130.02917.82
7.0.50.0030.04716.73
7.0.40.0070.02616.86
7.0.30.0100.02716.77
7.0.20.0130.02616.80
7.0.10.0180.02816.78
7.0.00.0100.04316.91
5.6.400.0040.00814.43
5.6.390.0090.00914.18
5.6.380.0030.00614.07
5.6.370.0040.01214.42
5.6.360.0030.00714.33
5.6.350.0070.01014.61
5.6.340.0060.01014.50
5.6.330.0090.00614.40
5.6.320.0090.00914.28
5.6.310.0040.00414.40
5.6.300.0070.01014.32
5.6.290.0000.01414.32
5.6.280.0060.04017.61
5.6.270.0040.01314.43
5.6.260.0080.00014.24
5.6.250.0090.00314.46
5.6.240.0030.00714.54
5.6.230.0100.00714.32
5.6.220.0080.00414.38
5.6.210.0100.04317.61
5.6.200.0080.04316.24
5.6.190.0030.02917.45
5.6.180.0200.03317.52
5.6.170.0170.02717.49
5.6.160.0090.04116.29
5.6.150.0080.02316.33
5.6.140.0080.03816.41
5.6.130.0000.02616.25
5.6.120.0080.04417.79
5.6.110.0110.02317.59
5.6.100.0100.04317.65
5.6.90.0070.04317.47
5.6.80.0070.03317.28
5.6.70.0040.00414.09
5.6.60.0030.01414.48
5.6.50.0120.00314.64
5.6.40.0040.00714.30
5.6.30.0060.00914.40
5.6.20.0030.01014.25
5.6.10.0100.00314.59
5.6.00.0070.00714.48
5.5.380.0040.01214.45
5.5.370.0060.00614.35
5.5.360.0040.00814.65
5.5.350.0120.04217.26
5.5.340.0020.02916.17
5.5.330.0060.03517.45
5.5.320.0060.04017.39
5.5.310.0180.03617.31
5.5.300.0100.01816.34
5.5.290.0090.04216.18
5.5.280.0080.02317.58
5.5.270.0020.02717.49
5.5.260.0070.03817.54
5.5.250.0140.03717.44
5.5.240.0100.02717.36
5.5.230.0030.01013.97
5.5.220.0060.01214.55
5.5.210.0070.01013.94
5.5.200.0100.00314.50
5.5.190.0090.00614.49
5.5.180.0030.00514.16
5.5.170.0080.00614.43
5.5.160.0060.00614.37
5.5.150.0030.01014.32
5.5.140.0040.00714.41
5.5.130.0030.00714.13
5.5.120.0060.00314.08
5.5.110.0090.00614.48
5.5.100.0070.00314.50
5.5.90.0140.00014.19
5.5.80.0070.00714.43
5.5.70.0000.01414.33
5.5.60.0070.00714.25
5.5.50.0040.01214.35
5.5.40.0030.00814.16
5.5.30.0110.00313.91
5.5.20.0050.00814.26
5.5.10.0050.00514.00
5.5.00.0130.00314.38
5.4.450.0070.03415.34
5.4.440.0410.03315.42
5.4.430.0280.02715.25
5.4.420.0350.00415.45
5.4.410.0050.03415.12
5.4.400.0130.03114.86
5.4.390.0180.03015.01
5.4.380.0190.02614.90
5.4.370.0080.03215.02
5.4.360.0100.02714.99
5.4.350.0080.01611.67
5.4.340.0060.02411.62
5.4.330.0060.00311.21
5.4.320.0040.02411.86
5.4.310.0030.02411.86
5.4.300.0050.02311.86
5.4.290.0030.02611.89
5.4.280.0040.02011.81
5.4.270.0040.02311.81
5.4.260.0050.02111.81
5.4.250.0060.02011.91
5.4.240.0060.02011.81
5.4.230.0040.02511.80
5.4.220.0050.02211.80
5.4.210.0050.02211.88
5.4.200.0060.02211.80
5.4.190.0060.02311.80
5.4.180.0080.02011.80
5.4.170.0060.02211.81
5.4.160.0070.02011.80
5.4.150.0080.01911.80
5.4.140.0050.02411.64
5.4.130.0060.02211.64
5.4.120.0030.02111.62
5.4.110.0060.02611.61
5.4.100.0040.02311.62
5.4.90.0030.02411.62
5.4.80.0050.02111.61
5.4.70.0090.01611.61
5.4.60.0020.02511.61
5.4.50.0050.02111.62
5.4.40.0040.02011.61
5.4.30.0040.02111.61
5.4.20.0070.02011.61
5.4.10.0050.02111.62
5.4.00.0070.02011.35
5.3.290.0050.02212.01
5.3.280.0050.02111.96
5.3.270.0050.02311.97
5.3.260.0050.02411.96
5.3.250.0050.02111.97
5.3.240.0080.02011.96
5.3.230.0050.02411.96
5.3.220.0040.02011.95
5.3.210.0040.02711.94
5.3.200.0040.02211.95
5.3.190.0070.02011.94
5.3.180.0050.02411.94
5.3.170.0030.02411.94
5.3.160.0080.02111.94
5.3.150.0080.02011.94
5.3.140.0050.02011.93
5.3.130.0070.02111.94
5.3.120.0070.02211.93
5.3.110.0090.02211.93
5.3.100.0040.02511.67
5.3.90.0090.01711.66
5.3.80.0040.02311.65
5.3.70.0090.01911.65
5.3.60.0060.02011.65
5.3.50.0070.01911.62
5.3.40.0040.02411.62
5.3.30.0070.01911.60
5.3.20.0060.02111.49
5.3.10.0020.02211.47
5.3.00.0030.02311.47
5.2.170.0050.0369.23
5.2.160.0050.0299.23
5.2.150.0040.0329.23
5.2.140.0050.0319.23
5.2.130.0060.0329.19
5.2.120.0050.0289.18
5.2.110.0050.0299.19
5.2.100.0120.0359.18
5.2.90.0080.0289.19
5.2.80.0030.0369.18
5.2.70.0100.0319.18
5.2.60.0050.0309.14
5.2.50.0060.0309.11
5.2.40.0070.0289.08
5.2.30.0050.0309.06
5.2.20.0090.0259.05
5.2.10.0050.0318.95
5.2.00.0070.0298.82
5.1.60.0020.0268.10
5.1.50.0030.0268.09
5.1.40.0060.0228.07
5.1.30.0050.0258.43
5.1.20.0050.0338.45
5.1.10.0060.0308.17
5.1.00.0050.0278.18
5.0.50.0030.0216.65
5.0.40.0040.0186.51
5.0.30.0020.0326.32
5.0.20.0030.0206.29
5.0.10.0010.0236.27
5.0.00.0070.0276.26
4.4.90.0030.0154.78
4.4.80.0000.0184.75
4.4.70.0020.0164.75
4.4.60.0010.0174.75
4.4.50.0010.0174.77
4.4.40.0020.0264.71
4.4.30.0050.0144.76
4.4.20.0070.0174.85
4.4.10.0040.0144.85
4.4.00.0030.0254.76
4.3.110.0020.0194.67
4.3.100.0040.0164.67
4.3.90.0030.0164.63
4.3.80.0040.0284.58
4.3.70.0030.0214.63
4.3.60.0010.0174.63
4.3.50.0070.0184.63
4.3.40.0010.0264.54
4.3.30.0050.0143.31
4.3.20.0010.0173.29
4.3.10.0020.0163.24
4.3.00.0000.0236.57

preferences:
57.46 ms | 403 KiB | 5 Q