3v4l.org

run code in 300+ PHP versions simultaneously
<?php function recurse(&$array, $pid = null) { foreach ($array as $id => $item) { if (isset($item->params->data->menu_display_special) && $item->params->data->menu_display_special == 1) { unset($array[$id]); recurse($array, $item->id); } elseif ($item->parent_id === $pid) { unset($array[$id]); } } } $list = [ 35 => (object)[ 'id' => '2375', 'params' => (object)[ 'data' => (object)[ 'menu_display_special' => '1' ] ], 'parent_id' => '2376', 'parent' => false ], 36 => (object)[ 'id' => '2377', 'params' => (object)[ 'data' => (object)[ 'menu_display_special' => '1' ] ], 'parent_id' => '2376', 'parent' => false ], 37 => (object)[ 'id' => '2379', 'params' => (object)[ 'data' => (object)[ 'menu_display_special' => '1' ] ], 'parent_id' => '2377', 'parent' => false ], 38 => (object)[ 'id' => '2380', 'params' => (object)[ 'data' => (object)[ 'menu_display_special' => '1' ] ], 'parent_id' => '2377', 'parent' => false ], 39 => (object)[ 'id' => '2381', 'params' => (object)[ 'data' => (object)[] ], 'parent_id' => '2377', 'parent' => false ], 40 => (object)[ 'id' => '2378', 'params' => (object)[ 'data' => (object)[] ], 'parent_id' => '2376', 'parent' => false ], ]; recurse($list); var_export($list);

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.130.0130.00817.79
8.4.120.0120.00820.35
8.4.110.0130.00618.95
8.4.100.0100.01118.06
8.4.90.0130.00819.55
8.4.80.0130.00718.08
8.4.70.0100.01218.03
8.4.60.0100.00619.07
8.4.50.0080.00318.92
8.4.40.0130.00622.06
8.4.30.0060.01317.90
8.4.20.0100.01420.56
8.4.10.0100.01017.84
8.3.260.0150.00716.64
8.3.250.0040.00418.86
8.3.240.0110.00716.51
8.3.230.0110.00816.87
8.3.220.0060.00216.79
8.3.210.0150.00416.66
8.3.200.0050.00416.88
8.3.190.0110.00017.19
8.3.180.0040.00416.74
8.3.170.0050.00320.60
8.3.160.0060.00318.67
8.3.150.0150.00416.82
8.3.140.0070.00718.90
8.3.130.0060.00318.77
8.3.120.0110.00720.61
8.3.110.0040.00416.70
8.3.100.0080.00024.06
8.3.90.0040.00426.77
8.3.80.0090.00017.97
8.3.70.0140.00716.90
8.3.60.0120.00618.43
8.3.50.0090.00618.40
8.3.40.0090.00918.72
8.3.30.0070.00718.77
8.3.20.0040.00418.77
8.3.10.0040.00423.59
8.3.00.0040.00421.43
8.2.290.0120.00718.99
8.2.280.0110.00720.23
8.2.270.0130.00718.79
8.2.260.0110.00416.99
8.2.250.0030.01018.59
8.2.240.0030.00518.83
8.2.230.0060.00320.94
8.2.220.0090.00037.54
8.2.210.0030.00626.77
8.2.200.0090.00018.28
8.2.190.0100.00616.85
8.2.180.0140.00416.63
8.2.170.0140.00322.96
8.2.160.0050.00920.34
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0040.00419.95
8.2.120.0040.00426.35
8.2.110.0030.00621.07
8.2.100.0040.00817.96
8.2.90.0040.00418.09
8.2.80.0080.00417.97
8.2.70.0030.00518.05
8.2.60.0080.00018.34
8.2.50.0080.00018.10
8.2.40.0030.00619.34
8.2.30.0050.00219.48
8.2.20.0050.00218.19
8.2.10.0050.00319.57
8.2.00.0000.00817.78
8.1.330.0070.00316.17
8.1.320.0080.01016.25
8.1.310.0000.00818.39
8.1.300.0040.00420.21
8.1.290.0030.00630.84
8.1.280.0110.00725.92
8.1.270.0050.00219.08
8.1.260.0090.00026.35
8.1.250.0070.00028.09
8.1.240.0060.00620.82
8.1.230.0080.00321.03
8.1.220.0060.00317.76
8.1.210.0050.00318.85
8.1.200.0040.00417.35
8.1.190.0030.00617.35
8.1.180.0040.00418.10
8.1.170.0080.00018.59
8.1.160.0000.00818.95
8.1.150.0070.00018.86
8.1.140.0080.00022.20
8.1.130.0030.00320.30
8.1.120.0070.00417.43
8.1.110.0040.00417.48
8.1.100.0040.00417.38
8.1.90.0040.00417.51
8.1.80.0030.00517.51
8.1.70.0000.00817.50
8.1.60.0030.00517.69
8.1.50.0030.00717.49
8.1.40.0040.00417.64
8.1.30.0040.00417.72
8.1.20.0030.00517.73
8.1.10.0000.00717.65
8.1.00.0070.00017.45
8.0.300.0030.00520.04
8.0.290.0000.00816.88
8.0.280.0040.00418.55
8.0.270.0110.00017.34
8.0.260.0000.00720.16
8.0.250.0000.00717.09
8.0.240.0000.00716.96
8.0.230.0040.00416.99
8.0.220.0030.00317.04
8.0.210.0030.00317.07
8.0.200.0030.00317.11
8.0.190.0080.00017.11
8.0.180.0000.00817.08
8.0.170.0070.00317.08
8.0.160.0000.00817.05
8.0.150.0040.00416.97
8.0.140.0000.00716.96
8.0.130.0040.00413.44
8.0.120.0000.00816.94
8.0.110.0000.00717.04
8.0.100.0040.00416.83
8.0.90.0000.00817.05
8.0.80.0100.00817.02
8.0.70.0000.00816.92
8.0.60.0040.00417.00
8.0.50.0030.00616.88
8.0.30.0090.00717.29
8.0.20.0050.01417.40
8.0.10.0000.00817.20
8.0.00.0160.00317.03
7.4.330.0000.00615.55
7.4.320.0030.00316.64
7.4.300.0060.00016.55
7.4.290.0030.00316.51
7.4.280.0080.00016.57
7.4.270.0030.00316.56
7.4.260.0000.00816.55
7.4.250.0000.00716.47
7.4.240.0070.00016.71
7.4.230.0030.00316.78
7.4.220.0000.00816.64
7.4.210.0090.00716.67
7.4.200.0040.00416.55
7.4.160.0120.00716.66
7.4.140.0140.00517.86
7.4.130.0180.01316.57
7.4.120.0110.00816.59
7.4.110.0100.00916.52
7.4.100.0100.00716.63
7.4.90.0160.00316.57
7.4.80.0110.00719.39
7.4.70.0130.00316.67
7.4.60.0060.01216.64
7.4.50.0070.00716.54
7.4.40.0040.01416.50
7.4.00.0070.01014.85
7.3.330.0030.00313.29
7.3.320.0060.00013.33
7.3.310.0040.00416.28
7.3.300.0060.00316.32
7.3.290.0070.00016.48
7.3.280.0060.00816.45
7.3.260.0100.01016.45
7.3.240.0090.00916.50
7.3.230.0060.01016.70
7.3.210.0090.00916.65
7.3.200.0050.01316.37
7.3.190.0080.00816.61
7.3.180.0170.00316.42
7.3.170.0070.01516.67
7.3.160.0100.01016.66
7.3.120.0070.01014.98
7.3.110.0040.01114.90
7.3.100.0040.00814.80
7.3.90.0030.00914.83
7.3.80.0060.00314.54
7.3.70.0060.00615.00
7.3.60.0100.00714.74
7.3.50.0070.00714.59
7.3.40.0090.00614.99
7.3.30.0040.01114.88
7.3.20.0130.00616.81
7.3.10.0120.00416.60
7.3.00.0030.01016.54
7.2.330.0100.01016.86
7.2.320.0070.01016.52
7.2.310.0100.00716.69
7.2.300.0100.00716.83
7.2.290.0090.01216.78
7.2.250.0070.01315.09
7.2.240.0000.01614.69
7.2.230.0120.00615.34
7.2.220.0060.00615.10
7.2.210.0040.01115.24
7.2.200.0100.01015.13
7.2.190.0040.01115.23
7.2.180.0080.00615.11
7.2.170.0050.00515.14
7.2.110.2750.01014.61
7.2.100.5380.01014.70
7.2.90.5170.00714.59
7.2.80.4410.00714.20
7.2.70.5080.00715.14
7.2.60.3970.01315.00
7.2.50.3570.00614.61
7.2.40.3400.01315.00
7.2.30.2270.00614.69
7.2.20.0990.00615.19
7.2.10.1000.00714.93
7.2.00.0380.01314.93
7.1.330.0030.00915.96
7.1.320.0060.00615.61
7.1.310.0090.00315.92
7.1.300.0060.00915.85
7.1.290.0000.01315.73
7.1.280.0090.00015.91
7.1.270.0090.00915.84
7.1.260.0060.00615.91
7.1.230.3210.00713.79
7.1.220.3520.01313.76
7.1.210.4450.01013.85
7.1.200.3900.01013.50
7.1.190.5000.00313.90
7.1.180.3690.00313.82
7.1.170.3770.01013.72
7.1.160.4400.01313.66
7.1.150.2590.00313.76
7.1.140.1580.00613.82
7.1.130.0730.00413.79
7.1.120.0300.00913.55
7.1.110.1230.00014.01
7.1.100.0970.00613.83
7.1.90.4310.00314.02
7.1.80.0370.00413.85
7.1.70.1890.00913.88
7.1.60.1340.01631.82
7.1.50.0490.01131.67
7.1.40.0790.00031.44
7.1.30.1490.01331.73
7.1.20.0450.00331.79
7.1.10.0360.00013.81
7.1.00.0720.00313.91
5.6.380.0080.00813.86

preferences:
27.54 ms | 403 KiB | 5 Q