3v4l.org

run code in 300+ PHP versions simultaneously
<?php $groupList = [ [ 'id' => 1, 'parent_id' => null, 'category' => null, 'children_list' => [ [ 'id' => 3, 'parent_id' => 1, 'category' => null, ], [ 'id' => 4, 'parent_id' => 1, 'category' => 'Category number 20', 'children_list' => [ [ 'id' => 7, 'parent_id' => 4, 'category' => null, ], [ 'id' => 8, 'parent_id' => 4, 'category' => 'Category number 30', ], ], ], ], ], 'id' => 2, 'parent_id' => null, 'category' => null, 'children_list' => [ [ 'id' => 5, 'parent_id' => 2, 'category' => null, 'children_list' => [ [ 'id' => 6, 'parent_id' => 5, 'category' => null, ], ], ], ], ]; $filter = array_map(function ($n){return f($n);}, $groupList[0]); echo '<pre>'; print_r($filter); function f(&$a){ foreach($a as $k=>&$r){ if(!$r['category']) unset($a[$k]); if($r['children_list']) $r['children_list']=f($r['children_list']); } return $a; }

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.5.20.0090.00819.64
8.5.10.0130.00516.95
8.5.00.0110.01120.34
8.4.170.0100.01122.07
8.4.160.0060.01522.18
8.4.150.0030.00014.05
8.4.140.0140.00617.78
8.4.130.0110.00418.93
8.4.120.0140.00719.61
8.4.110.0150.00619.94
8.4.100.0150.00618.04
8.4.90.0140.00620.70
8.4.80.0120.00918.88
8.4.70.0090.01020.66
8.4.60.0120.00820.51
8.4.50.0130.00718.63
8.4.40.0040.00417.71
8.4.30.0090.00320.64
8.4.20.0150.00017.83
8.4.10.0040.00418.88
8.3.300.0150.00618.66
8.3.290.0150.00620.95
8.3.280.0090.01218.67
8.3.270.0130.00716.64
8.3.260.0100.01016.66
8.3.250.0050.00518.34
8.3.240.0090.01116.93
8.3.230.0060.01016.80
8.3.220.0070.00118.92
8.3.210.0100.00916.95
8.3.200.0060.00416.79
8.3.190.0030.00617.15
8.3.180.0100.00918.94
8.3.170.0130.00717.00
8.3.160.0050.00517.07
8.3.150.0060.01216.80
8.3.140.0040.00417.07
8.3.130.0120.00318.53
8.3.120.0030.00618.93
8.3.110.0120.00420.94
8.3.100.0090.00624.06
8.3.90.0000.00826.77
8.3.80.0090.00316.75
8.3.70.0110.00716.75
8.3.60.0150.00618.68
8.3.50.0110.00718.15
8.3.40.0180.00020.38
8.3.30.0090.00618.79
8.3.20.0060.00324.18
8.3.10.0040.00424.66
8.3.00.0060.00326.16
8.2.300.0120.00920.38
8.2.290.0090.01016.79
8.2.280.0110.01118.46
8.2.270.0110.00718.28
8.2.260.0030.00617.37
8.2.250.0000.00816.77
8.2.240.0090.00018.27
8.2.230.0060.00322.58
8.2.220.0060.00637.54
8.2.210.0080.00026.77
8.2.200.0070.00316.88
8.2.190.0090.00616.88
8.2.180.0140.00425.92
8.2.170.0000.01519.09
8.2.160.0040.01122.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0100.00026.16
8.2.120.0080.00026.16
8.2.110.0030.00620.70
8.2.100.0040.00817.84
8.2.90.0030.00517.63
8.2.80.0060.00318.78
8.2.70.0000.00917.59
8.2.60.0030.00617.75
8.2.50.0050.00318.05
8.2.40.0080.00017.91
8.2.30.0040.00419.47
8.2.20.0000.00718.35
8.2.10.0000.00718.95
8.2.00.0070.00019.30
8.1.340.0160.00720.29
8.1.330.0110.00816.43
8.1.320.0120.00717.98
8.1.310.0040.01118.68
8.1.300.0040.01118.21
8.1.290.0030.00730.84
8.1.280.0100.01025.92
8.1.270.0030.01024.01
8.1.260.0150.00326.35
8.1.250.0000.00828.09
8.1.240.0060.00318.60
8.1.230.0080.00420.84
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0000.00817.35
8.1.190.0090.00316.88
8.1.180.0090.00018.10
8.1.170.0000.00818.71
8.1.160.0030.00318.93
8.1.150.0040.00418.66
8.1.140.0060.00317.36
8.1.130.0080.00020.67
8.1.120.0030.00417.47
8.1.110.0000.00717.48
8.1.100.0040.00417.45
8.1.90.0040.00417.49
8.1.80.0000.00817.56
8.1.70.0070.00017.43
8.1.60.0100.00317.59
8.1.50.0030.00617.42
8.1.40.0000.00817.44
8.1.30.0060.00317.57
8.1.20.0000.00817.63
8.1.10.0060.00317.51
8.1.00.0070.00017.53
8.0.300.0040.00418.77
8.0.290.0040.00416.75
8.0.280.0060.00318.66
8.0.270.0000.00716.90
8.0.260.0030.00318.54
8.0.250.0040.00416.89
8.0.240.0000.00716.98
8.0.230.0080.00016.97
8.0.220.0040.00417.00
8.0.210.0030.00316.98
8.0.200.0030.00317.04
8.0.190.0060.00316.91
8.0.180.0040.00416.90
8.0.170.0030.00617.02
8.0.160.0040.00416.82
8.0.150.0050.00316.96
8.0.140.0000.00916.96
8.0.130.0070.00013.39
8.0.120.0070.00316.92
8.0.110.0070.00016.99
8.0.100.0000.00716.96
8.0.90.0000.00817.00
8.0.80.0050.00316.82
8.0.70.0000.00816.97
8.0.60.0040.00416.98
8.0.50.0000.00716.81
8.0.30.0040.00416.95
8.0.20.0040.00416.93
8.0.10.0000.00717.02
8.0.00.0000.00716.97
7.4.330.0030.00315.55
7.4.320.0060.00016.52
7.4.300.0000.00716.64
7.4.290.0040.00416.37
7.4.280.0070.00016.60
7.4.270.0000.00716.68
7.4.260.0050.00013.35
7.4.250.0040.00416.50
7.4.240.0040.00416.44
7.4.230.0050.00216.44
7.4.220.0000.00716.61
7.4.210.0040.00416.53
7.4.200.0000.00716.48
7.4.190.0030.00316.75
7.4.180.0030.00316.54
7.4.160.0030.00516.51
7.4.150.0030.00516.48
7.4.140.0030.00316.52
7.4.130.0070.00016.49
7.4.120.0070.00016.43
7.4.110.0000.00716.39
7.4.100.0080.00016.43
7.4.90.0040.00416.54
7.4.80.0000.00716.31
7.4.70.0030.00316.52
7.4.60.0030.00316.44
7.4.50.0000.00716.43
7.4.40.0040.00416.31
7.4.30.0040.00416.49
7.4.20.0020.00516.52
7.4.10.0000.00716.53
7.4.00.0070.00016.47
7.3.330.0040.00816.46
7.3.320.0000.00613.39
7.3.310.0000.00716.39
7.3.300.0000.00616.31
7.3.290.0030.00316.36
7.3.280.0000.00616.47
7.3.270.0060.00016.31
7.3.260.0060.00016.25
7.3.250.0060.00016.30
7.3.240.0030.00316.46
7.3.230.0040.00416.46
7.3.220.0040.00416.19
7.3.210.0040.00416.32
7.3.200.0080.00016.23
7.3.190.0070.00016.35
7.3.180.0000.00716.22
7.3.170.0030.00316.26
7.3.160.0030.00316.46
7.3.150.0020.00516.41
7.3.140.0050.00316.42
7.3.130.0050.00216.38
7.3.120.0050.00216.42
7.3.110.0000.00716.34
7.3.100.0020.00516.34
7.3.90.0000.00716.46
7.3.80.0030.00316.22
7.3.70.0070.00016.43
7.3.60.0070.00016.34
7.3.50.0000.00716.44
7.3.40.0000.00716.60
7.3.30.0000.00716.58
7.3.20.0000.00718.19
7.3.10.0000.00818.07
7.3.00.0000.00818.17

preferences:
603.7 ms | 403 KiB | 5 Q