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[] = 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.0150.00316.75
8.3.50.0130.00817.25
8.3.40.0140.00718.85
8.3.30.0150.00418.85
8.3.20.0040.00418.60
8.3.10.0080.00018.56
8.3.00.0060.00319.25
8.2.180.0070.01116.50
8.2.170.0090.00622.96
8.2.160.0060.00918.96
8.2.150.0080.00024.18
8.2.140.0030.00524.66
8.2.130.0100.00726.16
8.2.120.0040.00419.66
8.2.110.0060.00320.52
8.2.100.0090.00617.91
8.2.90.0000.00817.88
8.2.80.0030.00518.77
8.2.70.0000.00817.75
8.2.60.0030.00718.03
8.2.50.0000.00818.07
8.2.40.0050.00319.36
8.2.30.0000.00817.76
8.2.20.0080.00017.63
8.2.10.0040.00417.87
8.2.00.0030.00617.69
8.1.280.0060.00925.92
8.1.270.0030.00623.99
8.1.260.0110.00726.35
8.1.250.0080.00028.09
8.1.240.0030.00619.06
8.1.230.0040.00717.77
8.1.220.0040.00417.74
8.1.210.0030.00518.77
8.1.200.0090.00017.25
8.1.190.0040.00417.22
8.1.180.0050.00318.10
8.1.170.0080.00018.59
8.1.160.0040.00419.07
8.1.150.0050.00218.70
8.1.140.0040.00417.52
8.1.130.0050.00319.27
8.1.120.0030.00517.38
8.1.110.0070.00017.50
8.1.100.0040.00417.47
8.1.90.0070.00017.47
8.1.80.0000.00717.43
8.1.70.0000.00717.38
8.1.60.0030.00517.61
8.1.50.0040.00417.59
8.1.40.0050.00317.50
8.1.30.0030.00817.72
8.1.20.0040.00417.71
8.1.10.0060.00317.59
8.1.00.0000.00717.49
8.0.300.0000.00718.77
8.0.290.0070.00016.63
8.0.280.0070.00018.70
8.0.270.0040.00417.27
8.0.260.0000.00716.95
8.0.250.0000.00817.00
8.0.240.0030.00316.96
8.0.230.0040.00417.01
8.0.220.0000.00716.80
8.0.210.0000.00816.90
8.0.200.0060.00016.96
8.0.190.0070.00016.84
8.0.180.0000.00716.85
8.0.170.0040.00416.83
8.0.160.0060.00316.94
8.0.150.0080.00016.91
8.0.140.0040.00416.75
8.0.130.0060.00013.38
8.0.120.0040.00416.82
8.0.110.0040.00416.73
8.0.100.0040.00416.86
8.0.90.0000.00716.73
8.0.80.0100.00316.89
8.0.70.0040.00416.77
8.0.60.0040.00416.96
8.0.50.0000.00716.70
8.0.30.0080.01117.21
8.0.20.0110.00817.24
8.0.10.0040.00416.92
8.0.00.0100.00916.85
7.4.330.0050.00012.99
7.4.320.0000.00616.52
7.4.300.0040.00416.54
7.4.290.0040.00416.45
7.4.280.0080.00016.63
7.4.270.0030.00516.50
7.4.260.0060.00013.31
7.4.250.0060.00316.65
7.4.240.0070.00016.43
7.4.230.0070.00016.68
7.4.220.0160.00416.55
7.4.210.0100.01116.66
7.4.200.0070.00016.55
7.4.190.0030.00516.42
7.4.160.0040.01416.60
7.4.150.0110.00816.55
7.4.140.0160.00917.86
7.4.130.0090.01216.50
7.4.120.0130.00816.64
7.4.110.0030.01616.56
7.4.100.0100.00716.39
7.4.90.0090.01016.48
7.4.80.0140.00719.39
7.4.70.0110.00616.60
7.4.60.0160.00316.48
7.4.50.0000.00616.48
7.4.40.0000.01416.55
7.4.30.0000.01616.52
7.4.00.0040.01114.92
7.3.330.0000.00513.33
7.3.320.0000.00513.16
7.3.310.0030.00316.22
7.3.300.0000.00716.34
7.3.290.0090.00616.35
7.3.280.0170.00316.34
7.3.270.0150.00316.57
7.3.260.0030.01316.60
7.3.240.0160.00016.57
7.3.230.0090.01416.57
7.3.210.0160.00416.38
7.3.200.0080.00816.42
7.3.190.0080.00816.34
7.3.180.0090.00916.53
7.3.170.0130.00316.57
7.3.160.0080.00816.39
7.3.120.0100.00715.07
7.2.330.0080.01516.52
7.2.320.0100.00716.74
7.2.310.0180.00616.76
7.2.300.0100.00716.72
7.2.290.0030.01316.68
7.1.70.0060.00317.28
7.1.60.0100.00319.21
7.1.50.0000.01117.04
7.1.00.0070.05322.36
7.0.200.0000.00716.53
7.0.140.0030.07021.91
7.0.120.0070.07022.13
7.0.60.0130.06019.80
7.0.50.0100.07717.87
7.0.40.0200.08320.40
7.0.30.0300.06320.14
7.0.20.0200.09020.16
7.0.10.0330.07020.25
7.0.00.0270.08320.20
5.6.280.0000.07721.09
5.6.210.0070.08020.69
5.6.200.0030.05318.16
5.6.190.0300.08020.64
5.6.180.0170.07020.48
5.6.170.0300.05720.55
5.6.160.0270.08020.49
5.6.150.0170.08320.34
5.6.140.0270.06720.40
5.6.130.0330.06720.24
5.6.120.0200.06320.50
5.6.110.0230.06020.12
5.6.100.0300.06020.18
5.6.90.0230.05720.18
5.6.80.0300.07319.73
5.6.70.0300.07719.79
5.6.60.0270.04019.55
5.6.50.0230.06019.79
5.6.40.0330.06719.88
5.6.30.0200.08019.59
5.6.20.0270.05019.71
5.6.10.0200.04019.85
5.6.00.0370.08319.71
5.5.350.0230.07020.41
5.5.340.0030.06718.02
5.5.330.0270.04720.43
5.5.320.0300.07720.38
5.5.310.0300.07720.29
5.5.300.0330.07720.14
5.5.290.0330.06720.00
5.5.280.0200.06320.21
5.5.270.0230.08020.11
5.5.260.0170.07320.13
5.5.250.0230.05020.01
5.5.240.0200.08319.69
5.5.230.0330.05719.68
5.5.220.0270.05319.37
5.5.210.0130.05719.70
5.5.200.0200.04719.43
5.5.190.0230.05719.68
5.5.180.0370.05719.58
5.5.160.0270.08019.32
5.5.150.0200.05019.52
5.5.140.0300.04019.60
5.5.130.0200.06319.65
5.5.120.0230.07019.32
5.5.110.0270.07019.42
5.5.100.0230.08019.37
5.5.90.0170.06319.46
5.5.80.0230.07719.42
5.5.70.0300.07319.28
5.5.60.0170.07319.54
5.5.50.0170.08019.48
5.5.40.0230.06719.43
5.5.30.0200.04319.21
5.5.20.0130.05019.61
5.5.10.0230.05019.46
5.5.00.0270.05319.27
5.4.450.0300.06719.57
5.4.440.0330.07019.47
5.4.430.0230.05719.27
5.4.420.0230.03319.28
5.4.410.0330.06019.39
5.4.400.0230.07719.26
5.4.390.0200.04718.85
5.4.380.0400.04719.15
5.4.370.0300.03719.25
5.4.360.0200.04718.87
5.4.350.0300.06019.21
5.4.340.0230.04319.11
5.4.320.0230.07319.08
5.4.310.0200.07719.16
5.4.300.0200.05018.85
5.4.290.0200.07318.96
5.4.280.0500.06319.25
5.4.270.0300.07019.14
5.4.260.0200.06719.24
5.4.250.0230.04019.25
5.4.240.0200.07318.85
5.4.230.0170.04719.25
5.4.220.0170.08018.86
5.4.210.0270.06719.23
5.4.200.0130.06019.11
5.4.190.0200.03319.14
5.4.180.0200.04319.14
5.4.170.0330.06319.25
5.4.160.0230.06319.10
5.4.150.0100.04719.13
5.4.140.0230.05016.38
5.4.130.0170.04016.35
5.4.120.0170.07016.36
5.4.110.0170.04016.44
5.4.100.0200.06316.45
5.4.90.0200.06716.50
5.4.80.0200.07316.42
5.4.70.0300.05716.38
5.4.60.0230.03316.37
5.4.50.0230.06316.31
5.4.40.0230.03016.31
5.4.30.0200.06716.25
5.4.20.0270.05316.45
5.4.10.0200.07016.36
5.4.00.0100.05315.90
5.3.290.0230.05314.71
5.3.280.0270.07014.63
5.3.270.0200.07014.60
5.3.260.0270.04314.66
5.3.250.0130.04314.68
5.3.240.0200.05014.63
5.3.230.0200.06014.63
5.3.220.0230.07314.62
5.3.210.0200.03714.58
5.3.200.0230.07714.62
5.3.190.0300.07014.71
5.3.180.0300.04314.48
5.3.170.0230.07714.56
5.3.160.0230.04014.57
5.3.150.0330.06014.48
5.3.140.0170.05714.71
5.3.130.0170.06014.59
5.3.120.0170.04014.58
5.3.110.0430.04714.56
5.3.100.0200.03714.09
5.3.90.0100.04314.04
5.3.80.0200.04713.91
5.3.70.0230.06714.05
5.3.60.0200.07314.16
5.3.50.0330.06313.95
5.3.40.0270.06013.97
5.3.30.0330.02713.95
5.3.20.0200.04013.76
5.3.10.0230.06713.58
5.3.00.0230.05013.70
5.2.170.0200.04312.79
5.2.160.0230.05312.79
5.2.150.0370.02712.79
5.2.140.0170.03712.79
5.2.130.0130.05012.79
5.2.120.0200.03012.79
5.2.110.0130.03712.79
5.2.100.0300.04312.79
5.2.90.0270.05312.79
5.2.80.0200.04312.79
5.2.70.0130.03712.79
5.2.60.0100.03712.79
5.2.50.0200.06012.79
5.2.40.0200.04712.79
5.2.30.0370.04312.79
5.2.20.0270.04712.79
5.2.10.0170.03012.79
5.2.00.0300.04712.79
5.1.60.0200.04712.79
5.1.50.0130.05312.79
5.1.40.0200.04012.79
5.1.30.0200.04312.79
5.1.20.0170.05312.79
5.1.10.0200.04312.79
5.1.00.0200.05312.79
5.0.50.0100.04312.79
5.0.40.0100.03712.79
5.0.30.0100.04312.79
5.0.20.0070.03312.79
5.0.10.0100.04312.79
5.0.00.0100.06012.79
4.4.90.0100.01312.79
4.4.80.0130.03012.79
4.4.70.0030.03712.79
4.4.60.0070.03012.79
4.4.50.0130.01712.79
4.4.40.0100.05312.79
4.4.30.0000.04312.79
4.4.20.0100.03312.79
4.4.10.0070.03712.79
4.4.00.0100.04012.79
4.3.110.0130.02712.79
4.3.100.0130.03312.79
4.3.90.0100.03312.79
4.3.80.0100.03312.79
4.3.70.0030.03312.79
4.3.60.0070.02712.79
4.3.50.0200.02012.79
4.3.40.0070.04712.79
4.3.30.0070.03312.79
4.3.20.0030.02712.79
4.3.10.0030.02712.79
4.3.00.0070.03712.79

preferences:
58.93 ms | 401 KiB | 5 Q