3v4l.org

run code in 300+ PHP versions simultaneously
<?php function coolPluck($array, $lookup) { $output = array(); foreach($array as $k => $v) { if($k === $lookup) { $output[$k] = $v; } if(is_array($v)) { $results = coolPluck($v, $lookup); if(isset($results[$lookup]) && isset($output[$lookup])) { if (is_array($output)) { $output[$lookup] = array_merge($output[$lookup], $results[$lookup]); } else { $output[$lookup] = array($output[$lookup], $results[$lookup]); } } else { $output = array_merge($output, $results); } } } return $output; } $testArray = array('test' => array('percy' => array('percy' => 'hatcherson'), 'percy' => array('mitchell', 'anderson'))); var_dump(coolPluck($testArray, 'percy'));

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.70.0000.01418.55
8.3.60.0140.00316.75
8.3.50.0130.00816.76
8.3.40.0110.00418.65
8.3.30.0030.01618.67
8.3.20.0080.00018.60
8.3.10.0040.00418.77
8.3.00.0090.00019.38
8.2.180.0110.00718.16
8.2.170.0070.00722.96
8.2.160.0060.01018.71
8.2.150.0040.00424.18
8.2.140.0090.00024.66
8.2.130.0140.00026.16
8.2.120.0080.00020.88
8.2.110.0070.00319.21
8.2.100.0070.00417.84
8.2.90.0040.00417.75
8.2.80.0060.00318.91
8.2.70.0100.00017.75
8.2.60.0080.00417.55
8.2.50.0030.00518.07
8.2.40.0000.00819.36
8.2.30.0040.00717.73
8.2.20.0030.00617.87
8.2.10.0000.00719.53
8.2.00.0040.00417.67
8.1.280.0040.01125.92
8.1.270.0060.00323.99
8.1.260.0030.01426.35
8.1.250.0080.00028.09
8.1.240.0000.01222.18
8.1.230.0070.00417.89
8.1.220.0000.00817.89
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0040.00417.38
8.1.180.0080.00018.10
8.1.170.0040.00418.57
8.1.160.0040.00419.08
8.1.150.0000.00718.74
8.1.140.0040.00417.37
8.1.130.0040.00419.23
8.1.120.0040.00417.46
8.1.110.0040.00417.55
8.1.100.0000.00717.48
8.1.90.0000.00817.52
8.1.80.0070.00017.51
8.1.70.0000.00717.45
8.1.60.0060.00317.54
8.1.50.0030.00617.55
8.1.40.0060.00317.46
8.1.30.0000.01117.74
8.1.20.0050.00317.66
8.1.10.0040.00417.48
8.1.00.0090.00017.55
8.0.300.0040.00418.77
8.0.290.0020.00516.88
8.0.280.0040.00418.62
8.0.270.0000.00717.17
8.0.260.0030.00316.86
8.0.250.0060.00316.96
8.0.240.0000.00917.01
8.0.230.0050.00216.87
8.0.220.0060.00316.99
8.0.210.0040.00416.93
8.0.200.0000.00716.99
8.0.190.0040.00416.92
8.0.180.0000.00716.91
8.0.170.0070.00316.83
8.0.160.0060.00316.81
8.0.150.0080.00016.78
8.0.140.0040.00416.85
8.0.130.0000.00513.43
8.0.120.0040.00416.71
8.0.110.0000.00716.76
8.0.100.0040.00416.97
8.0.90.0070.00016.81
8.0.80.0040.01116.98
8.0.70.0000.00716.87
8.0.60.0030.00616.98
8.0.50.0040.00416.95
8.0.30.0040.01416.91
8.0.20.0150.00417.38
8.0.10.0030.00617.00
8.0.00.0090.01017.00
7.4.330.0000.00513.01
7.4.320.0040.00416.65
7.4.300.0030.00316.61
7.4.290.0070.00016.61
7.4.280.0000.00716.64
7.4.270.0000.00616.56
7.4.260.0050.00013.40
7.4.250.0030.00516.59
7.4.240.0000.00716.54
7.4.230.0080.00016.44
7.4.220.0080.01216.51
7.4.210.0070.01416.74
7.4.200.0030.00316.71
7.4.190.0050.00316.73
7.4.160.0100.00716.56
7.4.150.0060.01516.61
7.4.140.0130.00617.86
7.4.130.0150.00316.76
7.4.120.0050.01416.62
7.4.110.0030.01416.53
7.4.100.0090.00916.52
7.4.90.0070.01016.45
7.4.80.0060.01019.39
7.4.70.0060.01116.50
7.4.60.0160.00016.53
7.4.50.0000.00416.63
7.4.40.0090.00616.40
7.4.30.0090.00916.61
7.4.00.0000.01514.90
7.3.330.0030.00313.39
7.3.320.0030.00313.21
7.3.310.0050.00316.42
7.3.300.0070.00016.34
7.3.290.0060.00916.38
7.3.280.0140.00716.27
7.3.270.0140.00316.50
7.3.260.0040.01316.52
7.3.240.0080.01216.31
7.3.230.0110.00616.49
7.3.210.0100.00716.25
7.3.200.0000.02016.39
7.3.190.0160.00016.54
7.3.180.0110.00516.53
7.3.170.0100.00716.48
7.3.160.0030.01316.41
7.3.120.0070.00715.01
7.2.330.0030.01616.72
7.2.320.0070.01016.77
7.2.310.0100.00716.53
7.2.300.0120.00616.76
7.2.290.0150.00316.69
7.2.00.0160.00419.48
7.1.70.0030.00516.91
7.1.60.0030.00716.96
7.1.50.0120.00916.98
7.1.00.0030.07022.47
7.0.200.0040.01116.85
7.0.140.0100.06722.11
7.0.120.0000.03722.13
7.0.60.0170.07719.94
7.0.50.0030.08717.91
7.0.40.0030.05020.24
7.0.30.0230.05020.08
7.0.20.0070.05020.23
7.0.10.0300.07720.10
7.0.00.0000.04720.08
5.6.280.0070.07021.16
5.6.210.0070.05720.63
5.6.200.0100.07318.18
5.6.190.0000.09720.77
5.6.180.0230.08020.75
5.6.170.0200.07020.55
5.6.160.0070.07020.56
5.6.150.0100.06718.23
5.6.140.0130.07318.28
5.6.130.0230.03718.28
5.6.120.0100.07721.09
5.6.110.0030.04721.00
5.6.100.0100.04721.07
5.6.90.0070.06720.97
5.6.80.0030.08720.38
5.6.70.0330.07020.33
5.5.350.0200.04020.45
5.5.340.0130.03717.96
5.5.330.0100.08320.39
5.5.320.0230.04320.43
5.5.310.0330.07320.32
5.5.300.0100.08317.93
5.5.290.0070.08018.07
5.5.280.0100.07020.77
5.5.270.0130.07720.73
5.5.260.0030.07320.86
5.5.250.0100.08020.50
5.5.240.0030.05020.19
5.4.450.0070.08019.48
5.4.440.0100.07719.46
5.4.430.0100.05019.46
5.4.420.0100.07719.16
5.4.410.0200.05019.17
5.4.400.0070.06019.25
5.4.390.0070.08319.24
5.4.380.0070.05719.12
5.4.370.0070.08018.92
5.4.360.0130.05318.87
5.4.350.0030.07718.89
5.4.340.0000.05018.84
5.4.320.0100.07319.21
5.4.310.0070.05319.12
5.4.300.0030.03718.99
5.4.290.0100.05319.14
5.4.280.0030.05318.89
5.4.270.0030.04018.92
5.4.260.0070.07019.14
5.4.250.0000.05019.14
5.4.240.0100.07319.23
5.4.230.0070.07718.99
5.4.220.0170.03719.15
5.4.210.0130.07018.97
5.4.200.0100.07018.83
5.4.190.0000.04019.14
5.4.180.0070.04018.84
5.4.170.0030.06019.23
5.4.160.0170.05319.13
5.4.150.0070.07719.13
5.4.140.0100.04016.41
5.4.130.0070.07016.46
5.4.120.0030.04316.34
5.4.110.0000.04016.43
5.4.100.0170.06016.45
5.4.90.0100.06716.39
5.4.80.0030.07316.38
5.4.70.0100.03316.29
5.4.60.0100.03016.64
5.4.50.0070.05316.28
5.4.40.0130.06316.40
5.4.30.0070.07016.50
5.4.20.0030.03716.40
5.4.10.0030.03716.41
5.4.00.0030.06315.95
5.3.290.0030.05314.74
5.3.280.0070.05314.67
5.3.270.0130.06714.64
5.3.260.0100.06014.66
5.3.250.0100.04714.68
5.3.240.0130.07314.62
5.3.230.0030.06714.63
5.3.220.0100.03014.59
5.3.210.0030.04714.60
5.3.200.0000.07714.63
5.3.190.0030.05714.58
5.3.180.0030.06714.72
5.3.170.0030.06314.72
5.3.160.0070.04314.48
5.3.150.0100.03014.57
5.3.140.0130.03714.57
5.3.130.0070.03714.46
5.3.120.0130.03714.58
5.3.110.0070.04314.59
5.3.100.0070.04314.05
5.3.90.0030.03714.04
5.3.80.0000.04314.18
5.3.70.0170.06013.93
5.3.60.0070.07314.01
5.3.50.0070.07013.91
5.3.40.0070.06713.97
5.3.30.0100.03313.92
5.3.20.0030.03713.75
5.3.10.0070.03313.71
5.3.00.0070.06713.53
5.2.170.0030.05711.10
5.2.160.0070.03711.11
5.2.150.0030.04011.11
5.2.140.0000.04011.06
5.2.130.0030.03011.10
5.2.120.0030.03011.07
5.2.110.0000.04011.12
5.2.100.0030.04711.06
5.2.90.0000.04711.07
5.2.80.0070.06011.11
5.2.70.0030.05311.09
5.2.60.0030.03711.00
5.2.50.0070.04710.99
5.2.40.0100.04710.92
5.2.30.0070.03310.91
5.2.20.0100.05710.88
5.2.10.0130.02710.83
5.2.00.0030.03710.63
5.1.60.0100.0479.98
5.1.50.0070.04010.00
5.1.40.0030.0509.88
5.1.30.0070.03010.33
5.1.20.0070.05710.31
5.1.10.0130.04710.09
5.1.00.0030.04310.11
5.0.50.0070.0178.63
5.0.40.0000.0478.38
5.0.30.0030.0438.21
5.0.20.0000.0208.23
5.0.10.0070.0438.24
5.0.00.0130.0578.15
4.4.90.0000.0277.84
4.4.80.0030.0337.84
4.4.70.0030.0307.84
4.4.60.0000.0377.84
4.4.50.0000.0277.84
4.4.40.0100.0507.84
4.4.30.0000.0377.84
4.4.20.0030.0307.84
4.4.10.0030.0177.84
4.4.00.0100.0507.84
4.3.110.0000.0237.84
4.3.100.0070.0107.84
4.3.90.0000.0177.84
4.3.80.0000.0577.84
4.3.70.0000.0337.84
4.3.60.0000.0277.84
4.3.50.0030.0337.84
4.3.40.0000.0507.84
4.3.30.0030.0137.84
4.3.20.0000.0177.84
4.3.10.0030.0137.84
4.3.00.0000.0177.84

preferences:
71.43 ms | 401 KiB | 5 Q