3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'entity_id' => 5740, 'parent_id' => 5739, 'label' => 'Sports', 'name' => 'sports', 'children' => [ [ 'entity_id' => 5754, 'parent_id' => 5740, 'label' => 'Badminton', 'name' => 'badminton', 'children' => [ [ 'entity_id' => 5756, 'parent_id' => 5754, 'label' => 'Tournaments', 'name' => 'tournaments', ] ], ] ], ]; function labelSearch(array $array, string $label): array { foreach ($array as $item) { if ($item['label'] === $label) { unset($item['children']); return $item; } if (isset($item['children'])) { $result = labelSearch($item['children'], $label); if ($result) { return $result; } } } return null; } var_export(labelSearch([$array], 'Badminton'));

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.10.0110.00816.82
8.5.00.0100.01119.99
8.4.150.0020.00014.05
8.4.140.0120.00817.28
8.4.130.0130.00717.82
8.4.120.0100.00924.23
8.4.110.0100.00917.85
8.4.100.0110.00217.45
8.4.90.0120.00917.69
8.4.80.0090.01019.61
8.4.70.0070.00217.77
8.4.60.0130.00617.82
8.4.50.0070.00218.62
8.4.40.0060.01318.86
8.4.30.0100.01018.80
8.4.20.0140.00721.18
8.4.10.0060.01319.39
8.3.280.0100.01018.41
8.3.270.0080.01116.59
8.3.260.0110.00816.86
8.3.250.0070.00719.04
8.3.240.0060.00319.00
8.3.230.0120.00616.69
8.3.220.0050.00316.55
8.3.210.0110.00716.51
8.3.200.0110.00816.52
8.3.190.0100.00918.44
8.3.180.0110.00917.18
8.3.170.0160.00617.34
8.3.160.0080.00020.70
8.3.150.0040.01117.23
8.3.140.0140.00720.78
8.3.130.0290.00318.23
8.3.120.0230.00818.13
8.3.110.0210.00418.25
8.3.100.0170.00316.56
8.3.90.0150.00816.71
8.3.80.0120.00916.30
8.3.70.0120.00816.59
8.3.60.0140.00716.61
8.3.50.0120.00816.57
8.3.40.0130.00617.56
8.3.30.0100.00717.45
8.3.20.0150.00017.32
8.3.10.0070.01017.20
8.3.00.0070.00318.98
8.2.290.0110.00918.93
8.2.280.0090.00616.86
8.2.270.0110.00816.70
8.2.260.0150.00316.22
8.2.250.0170.00016.83
8.2.240.0130.00416.67
8.2.230.0180.00016.31
8.2.220.0170.00317.89
8.2.210.0120.00416.24
8.2.200.0170.00016.43
8.2.190.0110.00716.46
8.2.180.0080.00818.19
8.2.170.0200.00017.57
8.2.160.0210.00019.08
8.2.150.0180.00019.31
8.2.140.0080.01117.16
8.2.130.0120.00817.42
8.2.120.0140.00417.24
8.2.110.0180.00017.53
8.2.100.0180.00017.24
8.2.90.0090.00917.49
8.2.80.0170.00017.09
8.2.70.0200.00017.52
8.2.60.0160.00417.43
8.2.50.0180.00019.16
8.2.40.0120.00617.51
8.2.30.0140.00317.51
8.2.20.0100.00518.85
8.2.10.0120.00417.34
8.2.00.0090.00917.39
8.1.330.0060.01321.84
8.1.320.0090.00916.06
8.1.310.0150.00317.71
8.1.300.0130.00516.03
8.1.290.0110.00616.08
8.1.280.0170.00015.93
8.1.270.0150.00317.22
8.1.260.0150.00317.66
8.1.250.0110.00717.13
8.1.240.0130.00317.39
8.1.230.0120.00317.04
8.1.220.0120.00517.31
8.1.210.0150.00316.99
8.1.200.0040.01216.80
8.1.190.0030.01316.96
8.1.180.0160.00017.09
8.1.170.0140.00317.22
8.1.160.0140.00517.06
8.1.150.0100.00817.07
8.1.140.0180.00016.84
8.1.130.0130.00417.28
8.1.120.0090.00917.14
8.1.110.0140.00517.11
8.1.100.0150.00417.21
8.1.90.0120.00617.12
8.1.80.0120.00417.15
8.1.70.0140.00417.26
8.1.60.0170.00017.23
8.1.50.0120.00617.47
8.1.40.0060.01217.01
8.1.30.0150.00417.40
8.1.20.0140.00417.39
8.1.10.0140.00217.18
8.1.00.0120.00617.11

preferences:
65.54 ms | 403 KiB | 5 Q