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])) { $output[$lookup] = array_merge((array) $output[$lookup], (array) $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.60.0120.00918.65
8.3.50.0110.00816.54
8.3.40.0130.00618.84
8.3.30.0090.00618.64
8.3.20.0030.00518.69
8.3.10.0080.00020.53
8.3.00.0060.00317.63
8.2.180.0110.00716.63
8.2.170.0100.00722.96
8.2.160.0000.01422.17
8.2.150.0030.00624.18
8.2.140.0040.00424.66
8.2.130.0000.00826.16
8.2.120.0040.00419.95
8.2.110.0030.00721.18
8.2.100.0040.00817.83
8.2.90.0030.00719.19
8.2.80.0040.00417.91
8.2.70.0000.00817.50
8.2.60.0040.00417.93
8.2.50.0050.00318.07
8.2.40.0040.00419.73
8.2.30.0000.00718.02
8.2.20.0040.00417.70
8.2.10.0080.00017.68
8.2.00.0000.00717.67
8.1.280.0100.00325.92
8.1.270.0040.00424.66
8.1.260.0000.00826.35
8.1.250.0070.00028.09
8.1.240.0060.00322.52
8.1.230.0090.00320.97
8.1.220.0060.00317.79
8.1.210.0060.00319.03
8.1.200.0000.00917.35
8.1.190.0000.00817.53
8.1.180.0000.00918.10
8.1.170.0080.00018.84
8.1.160.0000.00718.82
8.1.150.0070.00418.71
8.1.140.0040.00717.41
8.1.130.0030.00317.79
8.1.120.0000.00717.54
8.1.110.0030.00517.49
8.1.100.0000.00717.49
8.1.90.0100.00017.50
8.1.80.0100.00017.39
8.1.70.0000.00717.35
8.1.60.0030.00617.59
8.1.50.0040.00417.40
8.1.40.0000.00817.52
8.1.30.0020.00517.56
8.1.20.0050.00317.59
8.1.10.0040.00417.59
8.1.00.0000.00817.42
8.0.300.0050.00319.86
8.0.290.0080.00016.63
8.0.280.0000.00718.34
8.0.270.0070.00017.28
8.0.260.0000.00816.89
8.0.250.0000.00716.87
8.0.240.0040.00416.96
8.0.230.0070.00016.88
8.0.220.0040.00416.97
8.0.210.0000.00716.87
8.0.200.0000.00616.87
8.0.190.0080.00016.88
8.0.180.0000.00716.95
8.0.170.0040.00416.86
8.0.160.0050.00316.88
8.0.150.0030.00516.73
8.0.140.0080.00016.80
8.0.130.0030.00313.41
8.0.120.0030.00516.86
8.0.110.0040.00416.80
8.0.100.0050.00316.71
8.0.90.0000.00716.90
8.0.80.0110.00416.87
8.0.70.0030.00716.85
8.0.60.0040.00416.93
8.0.50.0000.00716.80
8.0.30.0130.00516.97
8.0.20.0100.01017.14
8.0.10.0080.00016.85
8.0.00.0100.01116.72
7.4.330.0000.00514.66
7.4.320.0080.00016.52
7.4.300.0040.00416.41
7.4.290.0060.00016.57
7.4.280.0080.00016.59
7.4.270.0000.00716.48
7.4.260.0060.00013.29
7.4.250.0040.00416.50
7.4.240.0080.00016.63
7.4.230.0030.00316.52
7.4.220.0110.01116.62
7.4.210.0100.00716.56
7.4.200.0040.00416.36
7.4.190.0030.00316.49
7.4.160.0120.00416.48
7.4.150.0030.01717.07
7.4.140.0050.01217.28
7.4.130.0150.00416.53
7.4.120.0140.00616.58
7.4.110.0040.01416.49
7.4.100.0100.01016.34
7.4.90.0090.00916.45
7.4.80.0100.00718.80
7.4.70.0100.00616.50
7.4.60.0040.01816.60
7.4.50.0050.00023.17
7.4.40.0120.00521.69
7.4.30.0060.01016.53
7.4.00.0100.00714.75
7.3.330.0030.00313.37
7.3.320.0000.00513.37
7.3.310.0000.00816.27
7.3.300.0030.00316.32
7.3.290.0100.00316.34
7.3.280.0090.00916.39
7.3.270.0110.00517.07
7.3.260.0110.00718.24
7.3.250.0150.00516.48
7.3.240.0160.00316.54
7.3.230.0100.00716.36
7.3.210.0070.01016.37
7.3.200.0090.01219.39
7.3.190.0100.00816.52
7.3.180.0160.00016.30
7.3.170.0030.01316.49
7.3.160.0110.00416.41
7.3.120.0040.01415.17
7.3.10.0050.00916.42
7.3.00.0100.00616.62
7.2.330.0060.01216.80
7.2.320.0120.00416.64
7.2.310.0070.01716.48
7.2.300.0160.00616.58
7.2.290.0030.01316.45
7.2.130.0000.01516.93
7.2.120.0090.00316.71
7.2.110.0110.00617.07
7.2.100.0060.00316.71
7.2.90.0030.00817.02
7.2.80.0110.00317.00
7.2.70.0030.00616.96
7.2.60.0140.00316.80
7.2.50.0090.00916.84
7.2.40.0030.01317.11
7.2.30.0130.00317.08
7.2.20.0100.00316.94
7.2.10.0070.00717.05
7.2.00.0020.01218.12
7.1.250.0030.00915.46
7.1.200.0040.00415.69
7.1.100.0030.00918.30
7.1.70.0040.00417.20
7.1.60.0120.01219.40
7.1.50.0060.01517.02
7.1.00.0070.07322.51
7.0.200.0000.00816.90
7.0.140.0070.07021.92
7.0.120.0000.03322.13
7.0.60.0100.07319.84
7.0.50.0100.05717.88
7.0.40.0100.07720.28
7.0.30.0230.03720.23
7.0.20.0200.04720.22
7.0.10.0270.07720.22
7.0.00.0030.07720.06
5.6.280.0000.07321.09
5.6.210.0100.07720.75
5.6.200.0130.07018.12
5.6.190.0000.05320.41
5.6.180.0070.05020.59
5.6.170.0270.05720.54
5.6.160.0000.04320.45
5.6.150.0030.05318.11
5.6.140.0070.07718.17
5.6.130.0100.06718.27
5.6.120.0070.07021.14
5.6.110.0100.07721.12
5.6.100.0070.07321.14
5.6.90.0070.08321.08
5.6.80.0100.08020.43
5.6.70.0200.08020.40
5.5.350.0200.06020.32
5.5.340.0030.08017.98
5.5.330.0030.04020.35
5.5.320.0000.09320.28
5.5.310.0300.07020.19
5.5.300.0070.08018.01
5.5.290.0130.07018.10
5.5.280.0130.05020.89
5.5.270.0070.05720.86
5.5.260.0030.06020.79
5.5.250.0030.04020.50
5.5.240.0000.04320.29
5.4.450.0400.06319.64
5.4.440.0430.03719.42
5.4.430.0300.03319.45
5.4.420.0430.06719.27
5.4.410.0370.04319.39
5.4.400.0270.05718.98
5.4.390.0330.04319.13
5.4.380.0200.05318.87
5.4.370.0270.04319.11
5.4.360.0330.07019.13
5.4.350.0370.06019.06
5.4.340.0270.04318.87
5.4.320.0300.04319.07
5.4.310.0300.04718.87
5.4.300.0330.06719.24
5.4.290.0400.03019.23
5.4.280.0400.05018.94
5.4.270.0370.04019.18
5.4.260.0200.04319.21
5.4.250.0400.03319.23
5.4.240.0330.03018.98
5.4.230.0230.03719.23
5.4.220.0330.06319.09
5.4.210.0300.07019.15
5.4.200.0330.04018.86
5.4.190.0230.04318.90
5.4.180.0300.06718.93
5.4.170.0370.06719.13
5.4.160.0270.04018.93
5.4.150.0230.03718.97
5.4.140.0270.04316.28
5.4.130.0430.04716.37
5.4.120.0270.04016.32
5.4.110.0270.05016.45
5.4.100.0170.04016.36
5.4.90.0230.07016.53
5.4.80.0230.04016.34
5.4.70.0270.04716.43
5.4.60.0370.06016.51
5.4.50.0500.02716.38
5.4.40.0400.06016.55
5.4.30.0370.06016.23
5.4.20.0330.06016.51
5.4.10.0400.06016.53
5.4.00.0370.03015.83
5.3.290.0330.07014.63
5.3.280.0330.03714.68
5.3.270.0300.05314.63
5.3.260.0400.06314.82
5.3.250.0330.04714.63
5.3.240.0300.06014.63
5.3.230.0230.04314.63
5.3.220.0430.03314.63
5.3.210.0200.05014.63
5.3.200.0470.05014.63
5.3.190.0300.03314.63
5.3.180.0300.04314.63
5.3.170.0370.06314.63
5.3.160.0430.03714.78
5.3.150.0300.06714.68
5.3.140.0300.06714.63
5.3.130.0300.06714.72
5.3.120.0270.04314.63
5.3.110.0230.07314.66
5.3.100.0270.04314.63
5.3.90.0170.04314.63
5.3.80.0330.06714.63
5.3.70.0370.04014.63
5.3.60.0370.03714.63
5.3.50.0300.03314.63
5.3.40.0330.03314.63
5.3.30.0330.06314.63
5.3.20.0370.06014.63
5.3.10.0370.05714.63
5.3.00.0300.04314.63
5.2.170.0270.03714.63
5.2.160.0330.02714.63
5.2.150.0300.04714.63
5.2.140.0270.04314.63
5.2.130.0230.02714.63
5.2.120.0130.03314.63
5.2.110.0230.06014.63
5.2.100.0200.02714.63
5.2.90.0330.05314.63
5.2.80.0200.06014.63
5.2.70.0130.03314.63
5.2.60.0230.05714.63
5.2.50.0270.02014.63
5.2.40.0270.02314.63
5.2.30.0200.04314.63
5.2.20.0170.03014.63
5.2.10.0200.02314.63
5.2.00.0330.04714.63
5.1.60.0200.03314.63
5.1.50.0300.05014.63
5.1.40.0370.03714.63
5.1.30.0270.05714.63
5.1.20.0230.04014.63
5.1.10.0270.05014.63
5.1.00.0330.04714.63
5.0.50.0130.04314.63
5.0.40.0130.02714.63
5.0.30.0070.03314.63
5.0.20.0130.04314.63
5.0.10.0130.01714.63
5.0.00.0200.03314.63
4.4.90.0130.02014.63
4.4.80.0100.02314.63
4.4.70.0130.02314.63
4.4.60.0130.02014.63
4.4.50.0100.01714.63
4.4.40.0100.04714.63
4.4.30.0130.01714.63
4.4.20.0130.03314.63
4.4.10.0170.02314.63
4.4.00.0130.02314.63
4.3.110.0130.03714.63
4.3.100.0130.01314.63
4.3.90.0170.02314.63
4.3.80.0100.02314.63
4.3.70.0100.03314.63
4.3.60.0100.03714.63
4.3.50.0100.02314.63
4.3.40.0130.04314.63
4.3.30.0100.01314.63
4.3.20.0070.03314.63
4.3.10.0030.04014.63
4.3.00.0100.02314.63

preferences:
47.39 ms | 401 KiB | 5 Q