3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array( array("title" => 1, "children" => array( array( "selected" => true, "key" => 12345, "children" => array() ) ) ) ); $selectedValues = array(); $iterator = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($tree)); foreach ($iterator as $key => $value) { if ($key == "selected" && $value) { $selectedValues[] = $iterator["key"]; } } var_dump($selectedValues);

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.01418.43
8.3.50.0130.00821.09
8.3.40.0040.01118.83
8.3.30.0140.00718.80
8.3.20.0060.00319.95
8.3.10.0120.00623.52
8.3.00.0040.00422.20
8.2.180.0100.01018.25
8.2.170.0120.00322.96
8.2.160.0030.01020.56
8.2.150.0080.00024.18
8.2.140.0160.00324.66
8.2.130.0080.00026.16
8.2.120.0040.00417.63
8.2.110.0040.00420.34
8.2.100.0060.00617.78
8.2.90.0080.00017.94
8.2.80.0050.00219.32
8.2.70.0040.00417.80
8.2.60.0000.00817.90
8.2.50.0000.00818.10
8.2.40.0040.00420.59
8.2.30.0040.00419.79
8.2.20.0020.00517.68
8.2.10.0000.00817.93
8.2.00.0000.00817.93
8.1.280.0150.00625.92
8.1.270.0000.00920.24
8.1.260.0110.00726.35
8.1.250.0080.00028.09
8.1.240.0090.00020.91
8.1.230.0060.00620.74
8.1.220.0040.00417.76
8.1.210.0060.00318.77
8.1.200.0040.00417.35
8.1.190.0050.00317.23
8.1.180.0060.00318.10
8.1.170.0050.00318.47
8.1.160.0000.00822.14
8.1.150.0040.00418.86
8.1.140.0040.00417.34
8.1.130.0070.00017.63
8.1.120.0070.00017.26
8.1.110.0070.00017.39
8.1.100.0000.00817.36
8.1.90.0040.00417.36
8.1.80.0000.00717.29
8.1.70.0030.00517.42
8.1.60.0050.00317.41
8.1.50.0000.00717.50
8.1.40.0030.00517.52
8.1.30.0080.00017.61
8.1.20.0030.00617.61
8.1.10.0000.00817.48
8.1.00.0000.00717.55
8.0.300.0070.00320.16
8.0.290.0030.00516.75
8.0.280.0030.00318.37
8.0.270.0000.00717.19
8.0.260.0000.00617.19
8.0.250.0040.00416.85
8.0.240.0030.00316.83
8.0.230.0090.00016.87
8.0.220.0030.00316.90
8.0.210.0000.00716.80
8.0.200.0030.00316.94
8.0.190.0090.00016.95
8.0.180.0050.00316.95
8.0.170.0040.00416.80
8.0.160.0050.00316.95
8.0.150.0070.00016.72
8.0.140.0040.00416.77
8.0.130.0050.00013.34
8.0.120.0080.00016.83
8.0.110.0000.00716.90
8.0.100.0070.00016.93
8.0.90.0080.00016.76
8.0.80.0090.00616.94
8.0.70.0000.00816.75
8.0.60.0040.00416.78
8.0.50.0070.00016.90
8.0.30.0090.00716.99
8.0.20.0110.00817.40
8.0.10.0000.00716.88
8.0.00.0070.00916.74
7.4.330.0050.00015.08
7.4.320.0030.00316.55
7.4.300.0060.00016.58
7.4.290.0000.00716.56
7.4.280.0000.00716.61
7.4.270.0070.00016.63
7.4.260.0040.00416.56
7.4.250.0000.00816.48
7.4.240.0060.00216.55
7.4.230.0000.00716.63
7.4.220.0140.00316.61
7.4.210.0030.01716.55
7.4.200.0080.00016.27
7.4.160.0080.00816.49
7.4.150.0090.00917.40
7.4.140.0120.01017.86
7.4.130.0110.00816.55
7.4.120.0090.01216.55
7.4.110.0190.00316.60
7.4.100.0090.01216.48
7.4.90.0060.01216.59
7.4.80.0180.00019.39
7.4.70.0120.00616.49
7.4.60.0030.01316.49
7.4.50.0040.00416.48
7.4.40.0110.00616.59
7.4.30.0060.01016.38
7.4.00.0080.00915.03
7.3.330.0030.00313.10
7.3.320.0060.00013.21
7.3.310.0000.00716.15
7.3.300.0030.00316.25
7.3.290.0080.01016.27
7.3.280.0120.00716.31
7.3.270.0090.00917.40
7.3.260.0040.01316.43
7.3.250.0120.01016.38
7.3.240.0070.01016.51
7.3.230.0090.00916.50
7.3.210.0110.00716.28
7.3.200.0140.00719.39
7.3.190.0100.00716.38
7.3.180.0090.00916.23
7.3.170.0070.01016.27
7.3.160.0100.00716.66
7.3.120.0070.01314.99
7.3.110.0140.00414.82
7.3.100.0040.00814.71
7.3.90.0090.00914.80
7.3.80.0070.01014.80
7.3.70.0060.00614.84
7.3.60.0070.00714.46
7.3.50.0130.00614.79
7.3.40.0060.00914.52
7.3.30.0060.00914.84
7.3.20.0070.00716.64
7.3.10.0070.00316.55
7.3.00.0080.00816.40
7.2.330.0130.01016.39
7.2.320.0100.00916.51
7.2.310.0170.00016.56
7.2.300.0100.00616.39
7.2.290.0070.01016.51
7.2.250.0060.01214.64
7.2.240.0200.00015.09
7.2.230.0030.01414.49
7.2.220.0100.01014.88
7.2.210.0000.01614.65
7.2.200.0000.01714.58
7.2.190.0030.01214.71
7.2.180.0100.00614.87
7.2.170.0030.01314.94
7.2.60.0030.01016.45
7.2.00.0120.00319.48
7.1.330.0030.00615.50
7.1.320.0060.00615.44
7.1.310.0030.01415.39
7.1.300.0100.01015.47
7.1.290.0070.00715.73
7.1.280.0000.01815.62
7.1.270.0000.01415.40
7.1.260.0030.01315.59
7.1.200.0070.00715.65
7.1.100.0100.01017.84
7.1.70.0030.01217.25
7.1.60.0060.01320.03
7.1.50.0030.01016.66
7.1.00.0030.07722.48
7.0.200.0040.00716.40
7.0.60.0200.07319.86
7.0.50.0070.03717.88
7.0.40.0030.08020.28
7.0.30.0170.04720.16
7.0.20.0200.08020.09
7.0.10.0070.07319.99
7.0.00.0000.06320.19
5.6.280.0100.02320.87
5.6.210.0030.04020.54
5.6.200.0100.08018.19
5.6.190.0130.04720.50
5.6.180.0130.04020.63
5.6.170.0300.06020.46
5.6.160.0030.04020.43
5.6.150.0130.07018.19
5.6.140.0070.08018.20
5.6.130.0000.06718.28
5.6.120.0100.03720.98
5.6.110.0030.09021.11
5.6.100.0070.04321.13
5.6.90.0070.04320.96
5.6.80.0070.08020.50
5.6.70.4100.04320.27
5.5.350.0230.04720.32
5.5.340.0170.07018.03
5.5.330.0070.04020.42
5.5.320.0300.04020.34
5.5.310.0330.03720.33
5.5.300.0130.07018.09
5.5.290.0100.07018.03
5.5.280.0030.04020.87
5.5.270.0030.05320.72
5.5.260.0130.03320.96
5.5.250.0070.05320.49
5.5.240.0270.07020.26
5.4.450.0630.04719.62
5.4.440.0600.05719.57
5.4.430.0730.05719.18
5.4.420.0600.06019.62
5.4.410.0670.04719.50
5.4.400.0630.05319.32
5.4.390.0670.05018.88
5.4.380.0700.07019.25
5.4.370.0700.04319.25
5.4.360.0600.05718.97
5.4.350.0870.06319.12
5.4.340.0730.05719.20
5.4.320.0730.05718.98
5.4.310.0630.06019.22
5.4.300.0870.04019.29
5.4.290.0900.04019.11
5.4.280.0670.07018.83
5.4.270.0730.05019.35
5.4.260.0800.04718.97
5.4.250.0830.04319.11
5.4.240.0830.04319.13
5.4.230.0700.05319.27
5.4.220.0830.06719.20
5.4.210.0730.05319.22
5.4.200.0770.04316.66
5.4.190.0700.05319.22
5.4.180.0700.05719.04
5.4.170.0800.05319.01
5.4.160.0800.04019.12
5.4.150.0730.05319.09
5.4.140.0670.05716.30
5.4.130.0770.04716.43
5.4.120.0630.05016.56
5.4.110.0670.04316.47
5.4.100.0530.06016.46
5.4.90.0670.05716.29
5.4.80.0900.04716.50
5.4.70.0900.05316.38
5.4.60.0070.05316.24
5.4.50.0030.06016.38
5.4.40.0300.07016.33
5.4.30.0330.07016.49
5.4.20.0200.04316.34

preferences:
56 ms | 401 KiB | 5 Q