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($array)); 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.0100.01018.55
8.3.50.0100.01221.14
8.3.40.0180.00418.68
8.3.30.0060.01318.80
8.3.20.0000.00720.16
8.3.10.0180.00023.32
8.3.00.0040.00422.51
8.2.180.0140.00718.66
8.2.170.0040.01122.96
8.2.160.0130.00720.39
8.2.150.0150.00324.18
8.2.140.0160.00324.66
8.2.130.0110.00426.16
8.2.120.0000.00917.88
8.2.110.0080.00321.15
8.2.100.0110.00017.75
8.2.90.0050.00219.17
8.2.80.0040.00417.97
8.2.70.0050.00317.63
8.2.60.0060.00317.93
8.2.50.0040.00418.07
8.2.40.0000.00821.01
8.2.30.0050.00319.94
8.2.20.0040.00417.86
8.2.10.0050.00317.99
8.2.00.0030.00518.12
8.1.280.0140.00725.92
8.1.270.0040.00420.24
8.1.260.0070.01326.35
8.1.250.0030.01428.09
8.1.240.0090.00022.68
8.1.230.0030.00917.48
8.1.220.0040.00417.74
8.1.210.0050.00318.77
8.1.200.0060.00317.34
8.1.190.0040.00417.25
8.1.180.0080.00018.10
8.1.170.0040.00418.55
8.1.160.0110.00022.01
8.1.150.0040.00418.94
8.1.140.0000.00817.53
8.1.130.0070.00017.75
8.1.120.0070.00017.44
8.1.110.0050.00217.47
8.1.100.0040.00417.44
8.1.90.0000.00817.39
8.1.80.0070.00017.36
8.1.70.0000.00717.41
8.1.60.0030.00617.63
8.1.50.0040.00417.56
8.1.40.0040.00417.52
8.1.30.0060.00317.48
8.1.20.0030.00617.60
8.1.10.0040.00417.63
8.1.00.0000.00717.40
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0070.00318.45
8.0.270.0000.00717.24
8.0.260.0000.00617.30
8.0.250.0040.00417.05
8.0.240.0040.00417.01
8.0.230.0000.01016.85
8.0.220.0000.00716.90
8.0.210.0040.00416.82
8.0.200.0040.00417.01
8.0.190.0090.00016.89
8.0.180.0040.00417.01
8.0.170.0080.00016.88
8.0.160.0060.00316.91
8.0.150.0070.00016.94
8.0.140.0040.00416.88
8.0.130.0030.00313.41
8.0.120.0040.00416.81
8.0.110.0040.00416.79
8.0.100.0070.00016.86
8.0.90.0050.00216.94
8.0.80.0090.00616.96
8.0.70.0050.00317.02
8.0.60.0000.00816.76
8.0.50.0030.00616.90
8.0.30.0100.00817.35
8.0.20.0140.00617.40
8.0.10.0050.00217.00
8.0.00.0110.00616.73
7.4.330.0050.00015.08
7.4.320.0000.00716.56
7.4.300.0060.00016.65
7.4.290.0030.00316.54
7.4.280.0000.00816.50
7.4.270.0030.00316.60
7.4.260.0070.00016.49
7.4.250.0070.00016.45
7.4.240.0030.00316.55
7.4.230.0030.00316.55
7.4.220.0000.01716.70
7.4.210.0060.00916.50
7.4.200.0000.00716.45
7.4.160.0090.00616.58
7.4.150.0030.01417.40
7.4.140.0080.01117.86
7.4.130.0150.00616.56
7.4.120.0080.00816.46
7.4.110.0150.00916.48
7.4.100.0150.00816.66
7.4.90.0150.00716.46
7.4.80.0040.01519.39
7.4.70.0120.00616.52
7.4.60.0130.00316.50
7.4.50.0050.00316.36
7.4.40.0000.02116.50
7.4.30.0120.00916.74
7.4.10.0040.01314.76
7.4.00.0080.00714.93
7.3.330.0000.00713.24
7.3.320.0060.00013.33
7.3.310.0030.00516.33
7.3.300.0000.00616.30
7.3.290.0080.00816.36
7.3.280.0110.00816.38
7.3.270.0100.00717.40
7.3.260.0120.00616.67
7.3.250.0110.00916.46
7.3.240.0100.00716.38
7.3.230.0070.01116.39
7.3.210.0130.00416.64
7.3.200.0030.01619.39
7.3.190.0130.00316.50
7.3.180.0090.01216.60
7.3.170.0100.01016.42
7.3.160.0060.01316.39
7.3.130.0100.01015.11
7.3.120.0120.00614.87
7.3.110.0110.00714.80
7.3.100.0000.01514.98
7.3.90.0090.00614.99
7.3.80.0060.00614.88
7.3.70.0120.00014.76
7.3.60.0070.00314.93
7.3.50.0070.01014.82
7.3.40.0110.00414.75
7.3.30.0040.00414.85
7.3.20.0070.00716.50
7.3.10.0050.01116.69
7.3.00.0030.01016.78
7.2.330.0120.00616.52
7.2.320.0150.00616.76
7.2.310.0130.00616.57
7.2.300.0130.00316.50
7.2.290.0160.00316.63
7.2.260.0100.01014.76
7.2.250.0040.00915.29
7.2.240.0030.01315.00
7.2.230.0040.01115.35
7.2.220.0060.01214.71
7.2.210.0040.01214.97
7.2.200.0040.01115.10
7.2.190.0070.01114.95
7.2.180.0040.01115.18
7.2.170.0000.01214.99
7.2.160.0120.00614.83
7.2.150.0140.00316.88
7.2.140.0070.00716.84
7.2.130.0070.00716.77
7.2.120.0070.00716.90
7.2.110.0060.01117.01
7.2.100.0050.00916.83
7.2.90.0070.00716.93
7.2.80.0090.00616.98
7.2.70.0010.01216.96
7.2.60.0050.00916.83
7.2.50.0040.00816.83
7.2.40.0040.00716.87
7.2.30.0070.00717.00
7.2.20.0050.00817.02
7.2.10.0070.00716.82
7.2.00.0100.00417.78
7.1.330.0110.00315.69
7.1.320.0140.00315.62
7.1.310.0060.01015.64
7.1.300.0030.01315.94
7.1.290.0040.00715.73
7.1.280.0080.00315.59
7.1.270.0050.00815.55
7.1.260.0000.01015.74
7.1.250.0060.00815.87
7.1.240.0030.01315.72
7.1.230.0060.00915.85
7.1.220.0050.00715.63
7.1.210.0030.01015.74
7.1.200.0040.00715.75
7.1.190.0060.00615.84
7.1.180.0080.00715.80
7.1.170.0030.01015.88
7.1.160.0070.00615.75
7.1.150.0040.00915.86
7.1.140.0050.00915.77
7.1.130.0100.00515.66
7.1.120.0050.00815.71
7.1.110.0010.00815.81
7.1.100.0060.00816.50
7.1.90.0080.00615.63
7.1.80.0030.01215.85
7.1.70.0060.00716.07
7.1.60.0060.00917.20
7.1.50.0070.01116.13
7.1.40.0070.00715.62
7.1.30.0030.00915.85
7.1.20.0030.00815.77
7.1.10.0050.00915.81
7.1.00.0050.02717.98
7.0.330.0090.00515.44
7.0.320.0070.00715.31
7.0.310.0050.01015.52
7.0.300.0030.00815.17
7.0.290.0040.00915.43
7.0.280.0060.00615.30
7.0.270.0070.00615.44
7.0.260.0020.01015.25
7.0.250.0070.00715.44
7.0.240.0080.00615.38
7.0.230.0050.00715.35
7.0.220.0070.00515.44
7.0.210.0060.00515.46
7.0.200.0030.00715.87
7.0.190.0080.00315.42
7.0.180.0030.00715.49
7.0.170.0060.00615.34
7.0.160.0020.01315.50
7.0.150.0020.00915.44
7.0.140.0030.01015.38
7.0.130.0050.00615.35
7.0.120.0070.00515.24
7.0.110.0110.00115.54
7.0.100.0060.00615.24
7.0.90.0030.00815.30
7.0.80.0080.00615.46
7.0.70.0040.00615.21
7.0.60.0030.01916.81
7.0.50.0040.01816.16
7.0.40.0090.02515.66
7.0.30.0080.02215.89
7.0.20.0090.02115.64
7.0.10.0030.02115.62
7.0.00.0090.03015.59
5.6.400.0030.00914.16
5.6.390.0040.01114.77
5.6.380.0050.00914.35
5.6.370.0080.00214.11
5.6.360.0050.00713.97
5.6.350.0070.00214.48
5.6.340.0040.01114.45
5.6.330.0050.00714.45
5.6.320.0020.01014.36
5.6.310.0080.00714.51
5.6.300.0060.00914.13
5.6.290.0060.00914.17
5.6.280.0070.01216.43
5.6.270.0050.00814.07
5.6.260.0030.00814.27
5.6.250.0050.01114.56
5.6.240.0050.00814.44
5.6.230.0020.01414.26
5.6.220.0040.00714.12
5.6.210.0040.01916.43
5.6.200.0030.03615.56
5.6.190.0130.02216.33
5.6.180.0080.02016.35
5.6.170.0140.02716.47
5.6.160.0030.01916.39
5.6.150.0080.03215.55
5.6.140.0070.02115.57
5.6.130.0070.03115.54
5.6.120.0120.02816.48
5.6.110.0100.02916.52
5.6.100.0080.02316.45
5.6.90.0050.02216.59
5.6.80.0050.03416.34
5.6.70.1560.01816.25
5.6.60.0030.00814.36
5.6.50.0000.01414.34
5.6.40.0080.00514.38
5.6.30.0100.00514.25
5.6.20.0020.00614.34
5.6.10.0070.00714.42
5.6.00.0040.00814.37
5.5.380.0080.00112.56
5.5.370.0030.00712.79
5.5.360.0000.01312.73
5.5.350.0170.02415.26
5.5.340.0060.03014.38
5.5.330.0070.01515.15
5.5.320.0120.03015.19
5.5.310.0100.01915.24
5.5.300.0080.02914.52
5.5.290.0090.01914.57
5.5.280.0060.01715.55
5.5.270.0080.02915.40
5.5.260.0080.01615.33
5.5.250.0130.02415.19
5.5.240.0090.03115.21
5.5.230.0020.01112.56
5.5.220.0030.00912.71
5.5.210.0070.00712.51
5.5.200.0060.00612.79
5.5.190.0060.00612.66
5.5.180.0060.00812.45
5.5.170.0030.00912.61
5.5.160.0050.00712.65
5.5.150.0030.00712.55
5.5.140.0060.00612.66
5.5.130.0040.00812.72
5.5.120.0030.00612.47
5.5.110.0060.00312.56
5.5.100.0060.00612.75
5.5.90.0060.00512.33
5.5.80.0050.00312.68
5.5.70.0020.00912.80
5.5.60.0050.00512.64
5.5.50.0010.00912.57
5.5.40.0050.00812.45
5.5.30.0050.00612.57
5.5.20.0040.00512.68
5.5.10.0030.00812.67
5.5.00.0060.00412.38
5.4.450.0210.02313.74
5.4.440.0250.02213.85
5.4.430.0170.02613.77
5.4.420.0270.02013.76
5.4.410.0240.02113.80
5.4.400.0190.02313.70
5.4.390.0210.02413.75
5.4.380.0200.02413.70
5.4.370.0210.02113.67
5.4.360.0250.02513.68
5.4.350.0220.02213.70
5.4.340.0190.02413.75
5.4.330.0050.00410.98
5.4.320.0220.02113.63
5.4.310.0200.02213.52
5.4.300.0220.01813.76
5.4.290.0210.02013.75
5.4.280.0140.02613.49
5.4.270.0220.02313.58
5.4.260.0210.02013.58
5.4.250.0240.02013.63
5.4.240.0210.01813.64
5.4.230.0200.02513.72
5.4.220.0220.02313.50
5.4.210.0230.01913.48
5.4.200.0200.02212.88
5.4.190.0230.02013.57
5.4.180.0250.01913.61
5.4.170.0190.02213.53
5.4.160.0220.02213.62
5.4.150.0260.01913.76
5.4.140.0220.02112.61
5.4.130.0260.02112.70
5.4.120.0230.02112.64
5.4.110.0260.01912.55
5.4.100.0250.01812.68
5.4.90.0260.01912.79
5.4.80.0270.02112.95
5.4.70.0220.02012.86
5.4.60.0060.01712.74
5.4.50.0030.02712.77
5.4.40.0110.01912.77
5.4.30.0140.02312.59
5.4.20.0090.03012.88
5.4.10.0020.00710.99
5.4.00.0050.00511.07

preferences:
62.93 ms | 401 KiB | 5 Q