3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = array ( 60 => array ( 'term_id' => 60, 'name' => 'Vinylbiler', 'slug' => 'vinylbiler', 'term_group' => 0, 'term_taxonomy_id' => 60, 'taxonomy' => 'toys', 'parent' => 0, 'count' => 2, 'filter' => 'raw', 'children' => array ( 63 => array ( 'term_id' => 63, 'name' => '1:43 serien', 'slug' => '143-serien', 'term_group' => 0, 'term_taxonomy_id' => 63, 'taxonomy' => 'toys', 'parent' => 60, 'count' => 2, 'filter' => 'raw', 'children' => array ( 64 => array ( 'term_id' => 64, 'name' => 'Gul', 'slug' => 'gul', 'term_group' => 0, 'term_taxonomy_id' => 64, 'taxonomy' => 'toys', 'parent' => 63, 'count' => 1, 'filter' => 'raw', 'children' => array ( ), ), 65 => array ( 'term_id' => 65, 'name' => 'Rød', 'slug' => 'rod', 'term_group' => 0, 'term_taxonomy_id' => 65, 'taxonomy' => 'toys', 'parent' => 63, 'count' => 1, 'filter' => 'raw', 'children' => array ( ), ), ), ), ), ) ); function search_array($array, $name) { foreach ($array as $key => $value) { if ($value['name'] == $name) { // found the term. remove any children of this value $value['children'] = array(); return $value; } elseif (is_array($value['children'])) { if (($child = search_array($value['children'], $name)) !== false) { $value['children'] = $child; return $value; } } } return false; } print_r(search_array($array, 'Vinylbiler')); print_r(search_array($array, '1:43 serien')); print_r(search_array($array, 'Rød')); print_r(search_array($array, 'Nick'));

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.00.0070.01520.16
8.4.150.0020.00014.05
8.4.140.0120.00917.52
8.4.130.0100.01017.63
8.4.120.0110.01020.77
8.4.110.0130.00822.38
8.4.100.0110.01117.95
8.4.90.0120.00818.66
8.4.80.0120.00817.79
8.4.70.0050.00418.09
8.4.60.0120.00818.66
8.4.50.0100.01118.49
8.4.40.0030.00519.61
8.4.30.0100.01018.48
8.4.20.0090.00920.40
8.4.10.0100.00717.84
8.3.280.0150.00618.50
8.3.270.0120.00716.67
8.3.260.0060.00316.40
8.3.250.0140.00618.78
8.3.240.0080.01217.16
8.3.230.0130.00616.47
8.3.220.0140.00518.99
8.3.210.0050.00318.44
8.3.200.0070.00216.55
8.3.190.0100.00817.12
8.3.180.0080.01018.61
8.3.170.0160.00320.61
8.3.160.0090.00017.22
8.3.150.0000.01917.39
8.3.140.0110.00717.36
8.3.130.0120.00418.41
8.3.120.0100.00020.50
8.3.110.0080.00020.94
8.3.100.0100.00024.06
8.3.90.0040.00726.77
8.3.80.0030.00619.36
8.3.70.0130.00616.58
8.3.60.0120.00618.56
8.3.50.0060.01118.07
8.3.40.0180.00918.82
8.3.30.0150.00018.84
8.3.20.0030.00520.86
8.3.10.0000.00723.64
8.3.00.0030.00521.77
8.2.290.0120.00820.44
8.2.280.0120.00718.38
8.2.270.0060.01318.80
8.2.260.0050.00316.32
8.2.250.0040.00418.34
8.2.240.0150.00318.86
8.2.230.0060.00622.58
8.2.220.0060.00337.54
8.2.210.0000.00826.77
8.2.200.0060.00318.88
8.2.190.0090.00618.43
8.2.180.0160.00318.16
8.2.170.0040.01122.96
8.2.160.0060.00821.99
8.2.150.0000.00724.18
8.2.140.0120.00324.66
8.2.130.0040.00426.16
8.2.120.0120.00319.77
8.2.110.0000.01022.11
8.2.100.0040.00817.72
8.2.90.0090.00019.20
8.2.80.0040.00417.97
8.2.70.0060.00317.63
8.2.60.0090.00017.93
8.2.50.0040.00418.07
8.2.40.0040.00418.22
8.2.30.0050.00318.10
8.2.20.0050.00218.11
8.2.10.0030.00619.32
8.2.00.0000.00719.47
8.1.330.0120.00821.92
8.1.320.0100.00916.29
8.1.310.0040.00418.39
8.1.300.0120.00320.19
8.1.290.0070.00430.84
8.1.280.0000.01425.92
8.1.270.0040.00419.00
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0070.00419.13
8.1.230.0060.00618.95
8.1.220.0050.00317.79
8.1.210.0050.00318.77
8.1.200.0080.00017.35
8.1.190.0080.00017.23
8.1.180.0060.00318.10
8.1.170.0000.00818.90
8.1.160.0060.00318.95
8.1.150.0000.00818.98
8.1.140.0070.00017.51
8.1.130.0040.00417.32
8.1.120.0040.00417.51
8.1.110.0000.00717.45
8.1.100.0040.00717.50
8.1.90.0100.00017.34
8.1.80.0050.00317.49
8.1.70.0080.00017.42
8.1.60.0040.00417.58
8.1.50.0040.00417.53
8.1.40.0030.00617.41
8.1.30.0050.00317.75
8.1.20.0030.00617.63
8.1.10.0030.00617.42
8.1.00.0040.00417.39
8.0.300.0070.00018.77
8.0.290.0000.00816.63
8.0.280.0030.00318.39
8.0.270.0070.00016.90
8.0.260.0030.00316.88
8.0.250.0000.00717.00
8.0.240.0040.00417.02
8.0.230.0030.00616.85
8.0.220.0040.00316.94
8.0.210.0000.00716.79
8.0.200.0060.00016.95
8.0.190.0080.00016.92
8.0.180.0030.00516.93
8.0.170.0050.00516.92
8.0.160.0040.00416.88
8.0.150.0060.00316.93
8.0.140.0000.01116.86
8.0.130.0030.00313.36
8.0.120.0000.00716.73
8.0.110.0080.00016.77
8.0.100.0000.00716.91
8.0.90.0000.00716.96
8.0.80.0090.00816.91
8.0.70.0000.00716.99
8.0.60.0040.00416.94
8.0.50.0000.00816.73
8.0.30.0070.00717.24
8.0.20.0190.00917.40
8.0.10.0040.00417.08
8.0.00.0090.00916.87
7.4.330.0030.00316.81
7.4.320.0000.00616.49
7.4.300.0000.00616.45
7.4.290.0070.00016.61
7.4.280.0000.00716.49
7.4.270.0070.00016.46
7.4.260.0030.00316.39
7.4.250.0030.00316.58
7.4.240.0030.00316.55
7.4.230.0040.00416.41
7.4.220.0070.00016.61
7.4.210.0040.00916.60
7.4.200.0040.00316.35
7.4.160.0080.00816.55
7.4.140.0120.00917.86
7.4.130.0080.01016.56
7.4.120.0030.01316.71
7.4.110.0130.00716.55
7.4.100.0090.01316.51
7.4.90.0030.01316.60
7.4.80.0070.01019.39
7.4.70.0120.01216.49
7.4.60.0030.01316.48
7.4.50.0130.00016.41
7.4.40.0090.00616.41
7.4.00.0060.00914.91
7.3.330.0050.00013.32
7.3.320.0000.00613.22
7.3.310.0030.00316.26
7.3.300.0000.00716.23
7.3.290.0030.00316.24
7.3.280.0070.00916.40
7.3.260.0130.00716.42
7.3.240.0110.00916.39
7.3.230.0080.00816.56
7.3.210.0070.01016.61
7.3.200.0100.01116.36
7.3.190.0090.01216.42
7.3.180.0030.01416.37
7.3.170.0110.01016.43
7.3.160.0140.00716.50
7.3.120.0040.01114.80
7.3.110.0000.01315.07
7.3.100.0050.00514.61
7.3.90.0060.00914.98
7.3.80.0090.00614.71
7.3.70.0080.00014.84
7.3.60.0100.00314.59
7.3.50.0040.01114.48
7.3.40.0030.01014.77
7.3.30.0060.00914.70
7.3.20.0080.00816.56
7.3.10.0030.00716.64
7.3.00.0250.00515.45
7.2.330.0050.01416.76
7.2.320.0060.01316.70
7.2.310.0000.01616.79
7.2.300.0120.00816.44
7.2.290.0120.00916.66
7.2.240.0070.00414.96
7.2.230.0040.01115.26
7.2.220.0060.00915.13
7.2.210.0100.00614.99
7.2.200.0030.01214.93
7.2.190.0120.00315.08
7.2.180.0070.00414.79
7.2.170.0070.00714.88
7.2.160.0000.01214.88
7.2.150.0080.00816.88
7.2.140.0110.00717.06
7.2.130.0190.00815.96
7.2.120.0160.00915.94
7.2.110.0150.00815.92
7.2.100.0140.00915.95
7.2.90.0100.01316.09
7.2.80.0220.00516.04
7.2.70.0170.00615.86
7.2.60.0170.00715.94
7.2.50.0290.00315.90
7.2.40.0140.00915.97
7.2.30.0180.00416.01
7.2.20.0250.00515.84
7.2.10.0160.00615.99
7.2.00.0190.00416.03
7.1.330.0070.00715.92
7.1.320.0060.00615.55
7.1.310.0000.01415.48
7.1.300.0030.01215.61
7.1.290.0060.00615.89
7.1.280.0070.00715.61
7.1.270.0060.00615.81
7.1.260.0030.00715.87
7.1.250.0110.01214.82
7.0.330.1080.00013.27
5.6.380.0060.01214.18

preferences:
162.77 ms | 403 KiB | 5 Q