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; } else if(is_array($v)) { $results = coolPluck($v, $lookup); if(isset($results[$lookup]) && isset($output[$lookup])) { $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, 0));

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.00616.63
8.3.50.0170.00917.43
8.3.40.0080.00818.52
8.3.30.0070.01118.61
8.3.20.0050.00318.73
8.3.10.0040.00418.77
8.3.00.0060.00319.38
8.2.180.0110.00416.88
8.2.170.0140.00722.96
8.2.160.0190.00618.83
8.2.150.0030.00624.18
8.2.140.0000.00924.66
8.2.130.0000.00726.16
8.2.120.0080.00019.77
8.2.110.0070.00321.99
8.2.100.0050.01017.83
8.2.90.0040.00417.75
8.2.80.0060.00318.85
8.2.70.0000.00917.62
8.2.60.0030.00518.03
8.2.50.0070.00017.92
8.2.40.0000.00819.48
8.2.30.0080.00017.65
8.2.20.0000.00917.66
8.2.10.0060.00317.64
8.2.00.0020.00517.73
8.1.280.0080.00825.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0000.00928.09
8.1.240.0060.00322.19
8.1.230.0070.00417.83
8.1.220.0000.00817.78
8.1.210.0050.00318.77
8.1.200.0060.00317.48
8.1.190.0050.00317.38
8.1.180.0040.00418.10
8.1.170.0080.00017.62
8.1.160.0020.00519.04
8.1.150.0040.00418.67
8.1.140.0080.00017.48
8.1.130.0070.00019.29
8.1.120.0030.00317.39
8.1.110.0000.00717.50
8.1.100.0070.00017.44
8.1.90.0070.00017.48
8.1.80.0050.00217.38
8.1.70.0040.00417.48
8.1.60.0040.00417.57
8.1.50.0030.00617.46
8.1.40.0000.00817.50
8.1.30.0000.01117.55
8.1.20.0000.00817.55
8.1.10.0000.00817.53
8.1.00.0000.00817.38
8.0.300.0030.00620.09
8.0.290.0000.00816.60
8.0.280.0000.00718.60
8.0.270.0070.00017.22
8.0.260.0030.00616.76
8.0.250.0040.00416.86
8.0.240.0000.00716.85
8.0.230.0030.00617.04
8.0.220.0000.00716.94
8.0.210.0060.00316.84
8.0.200.0000.00717.01
8.0.190.0040.00417.00
8.0.180.0000.00816.97
8.0.170.0000.00916.95
8.0.160.0090.00016.91
8.0.150.0040.00416.82
8.0.140.0040.00416.86
8.0.130.0070.00013.43
8.0.120.0030.00616.85
8.0.110.0000.00716.80
8.0.100.0000.00816.79
8.0.90.0000.00716.88
8.0.80.0070.00716.93
8.0.70.0040.00416.80
8.0.60.0000.00816.98
8.0.50.0030.00616.92
8.0.30.0090.00916.86
8.0.20.0160.00517.20
8.0.10.0070.00017.06
8.0.00.0080.01016.70
7.4.330.0060.00013.01
7.4.320.0000.00616.39
7.4.300.0030.00316.50
7.4.290.0030.00516.61
7.4.280.0000.00716.61
7.4.270.0030.00316.63
7.4.260.0030.00313.34
7.4.250.0030.00616.48
7.4.240.0040.00416.65
7.4.230.0040.00416.70
7.4.220.0110.01116.48
7.4.210.0030.01416.49
7.4.200.0040.00416.64
7.4.190.0000.00716.60
7.4.160.0030.01316.50
7.4.150.0100.00716.64
7.4.140.0140.00917.86
7.4.130.0090.00916.43
7.4.120.0160.00316.71
7.4.110.0080.01316.45
7.4.100.0070.01016.50
7.4.90.0090.00916.54
7.4.80.0080.00819.39
7.4.70.0150.00716.59
7.4.60.0100.00716.30
7.4.50.0000.00616.30
7.4.40.0110.00416.45
7.4.30.0080.01116.53
7.4.00.0070.01014.90
7.3.330.0050.00013.34
7.3.320.0000.00713.16
7.3.310.0040.00416.25
7.3.300.0040.00416.38
7.3.290.0100.00716.34
7.3.280.0150.00016.32
7.3.270.0100.00716.57
7.3.260.0110.01116.56
7.3.240.0030.01316.50
7.3.230.0070.01016.67
7.3.210.0100.01316.38
7.3.200.0100.00716.42
7.3.190.0060.01216.41
7.3.180.0080.00816.70
7.3.170.0130.00316.38
7.3.160.0030.01316.34
7.3.120.0060.00915.04
7.2.330.0100.01616.51
7.2.320.0090.00916.81
7.2.310.0090.00916.65
7.2.300.0060.01116.65
7.2.290.0150.00916.73
7.2.00.0040.01119.20
7.1.100.0040.00718.16
7.1.70.0000.00717.25
7.1.60.0120.00919.21
7.1.50.0160.00317.07
7.1.00.0030.03722.44
7.0.200.0000.00816.96
7.0.140.0030.07322.11
7.0.120.0070.07022.13
7.0.60.0100.08019.81
7.0.50.0030.07317.84
7.0.40.0270.05020.28
7.0.30.0330.07320.41
7.0.20.0200.04320.25
7.0.10.0300.06720.18
7.0.00.0300.06720.23
5.6.280.0000.07721.00
5.6.210.0030.08720.71
5.6.200.0030.04718.25
5.6.190.0300.07720.33
5.6.180.0230.08320.55
5.6.170.0200.08320.39
5.6.160.0370.07320.54
5.6.150.0300.07720.18
5.6.140.0270.04320.32
5.6.130.0370.04720.50
5.6.120.0230.04320.17
5.6.110.0270.08720.40
5.6.100.0230.05020.52
5.6.90.0270.08020.22
5.6.80.0170.04319.79
5.6.70.0230.06719.79
5.6.60.0230.05319.80
5.6.50.0200.05319.72
5.6.40.0370.06319.77
5.6.30.0230.04019.70
5.6.20.0200.08319.88
5.6.10.0200.06719.53
5.6.00.0270.08019.76
5.5.350.0270.06720.41
5.5.340.0030.05017.98
5.5.330.0200.06020.19
5.5.320.0270.07720.35
5.5.310.0200.05320.27
5.5.300.0300.07319.98
5.5.290.0200.07020.14
5.5.280.0230.05320.15
5.5.270.0230.04320.20
5.5.260.0270.05720.29
5.5.250.0300.07319.84
5.5.240.0300.05019.59
5.5.230.0200.06719.36
5.5.220.0300.06319.45
5.5.210.0230.05019.67
5.5.200.0270.07019.57
5.5.190.0200.08019.48
5.5.180.0300.06019.65
5.5.160.0230.07019.33
5.5.150.0270.08019.67
5.5.140.0330.07019.47
5.5.130.0230.08319.48
5.5.120.0270.07019.55
5.5.110.0200.08319.64
5.5.100.0230.04719.29
5.5.90.0100.05719.57
5.5.80.0200.05319.54
5.5.70.0200.04019.23
5.5.60.0300.07019.27
5.5.50.0230.03719.34
5.5.40.0200.06019.43
5.5.30.0230.06719.21
5.5.20.0230.07719.46
5.5.10.0230.04019.37
5.5.00.0230.04719.51
5.4.450.0300.07019.21
5.4.440.0270.06719.29
5.4.430.0200.04019.47
5.4.420.0300.07019.18
5.4.410.0370.05719.07
5.4.400.0300.06019.16
5.4.390.0330.07018.87
5.4.380.0400.03019.01
5.4.370.0200.05319.14
5.4.360.0300.07018.98
5.4.350.0330.05019.25
5.4.340.0200.08018.93
5.4.320.0170.06319.27
5.4.310.0270.08018.88
5.4.300.0200.06019.10
5.4.290.0200.06319.21
5.4.280.0300.05719.18
5.4.270.0300.06718.84
5.4.260.0230.05319.25
5.4.250.0270.06718.85
5.4.240.0200.05719.00
5.4.230.0200.04719.14
5.4.220.0230.04319.24
5.4.210.0230.03319.00
5.4.200.0270.03018.92
5.4.190.0230.04719.07
5.4.180.0270.05718.99
5.4.170.0230.07018.97
5.4.160.0230.07319.13
5.4.150.0130.08019.13
5.4.140.0200.07016.34
5.4.130.0230.07316.45
5.4.120.0230.04316.42
5.4.110.0230.07016.41
5.4.100.0270.06316.48
5.4.90.0230.04016.48
5.4.80.0130.04316.32
5.4.70.0170.04316.38
5.4.60.0200.03316.31
5.4.50.0230.05716.37
5.4.40.0200.06016.39
5.4.30.0330.06016.34
5.4.20.0200.07016.39
5.4.10.0170.04016.48
5.4.00.0230.06715.82
5.3.290.0300.06714.68
5.3.280.0300.04314.61
5.3.270.0170.04314.66
5.3.260.0270.07314.75
5.3.250.0230.05014.63
5.3.240.0230.06714.76
5.3.230.0230.07014.61
5.3.220.0200.05014.56
5.3.210.0230.05014.57
5.3.200.0170.08014.58
5.3.190.0330.06714.61
5.3.180.0230.04714.56
5.3.170.0170.04714.59
5.3.160.0370.05714.57
5.3.150.0270.06714.57
5.3.140.0200.06714.60
5.3.130.0270.06714.55
5.3.120.0230.04314.46
5.3.110.0270.05314.70
5.3.100.0200.07014.03
5.3.90.0170.05014.03
5.3.80.0270.07313.97
5.3.70.0230.04314.07
5.3.60.0200.07314.04
5.3.50.0230.07313.84
5.3.40.0230.07313.95
5.3.30.0330.06713.91
5.3.20.0200.05713.73
5.3.10.0270.04013.62
5.3.00.0230.07313.61
5.2.170.0130.05312.64
5.2.160.0100.04312.64
5.2.150.0230.04712.64
5.2.140.0200.05712.64
5.2.130.0200.05012.64
5.2.120.0230.05312.64
5.2.110.0230.05312.64
5.2.100.0170.03312.64
5.2.90.0270.02012.64
5.2.80.0230.03312.64
5.2.70.0200.04312.64
5.2.60.0230.02712.64
5.2.50.0230.02712.64
5.2.40.0170.02712.64
5.2.30.0200.04012.64
5.2.20.0130.04012.64
5.2.10.0200.05312.64
5.2.00.0170.06012.64
5.1.60.0200.04312.64
5.1.50.0130.05012.64
5.1.40.0200.04712.64
5.1.30.0170.04012.64
5.1.20.0130.02712.64
5.1.10.0170.04012.64
5.1.00.0130.02712.64
5.0.50.0070.03312.64
5.0.40.0070.03312.64
5.0.30.0130.05012.64
5.0.20.0030.02012.64
5.0.10.0000.02312.64
5.0.00.0070.06012.64
4.4.90.0070.02012.64
4.4.80.0070.01712.64
4.4.70.0130.02312.64
4.4.60.0030.03312.64
4.4.50.0070.02712.64
4.4.40.0070.02712.64
4.4.30.0070.02012.64
4.4.20.0030.03712.64
4.4.10.0030.01712.64
4.4.00.0100.02712.64
4.3.110.0030.02012.64
4.3.100.0100.02012.64
4.3.90.0000.02012.64
4.3.80.0030.05012.64
4.3.70.0070.02712.64
4.3.60.0030.03012.64
4.3.50.0030.03012.64
4.3.40.0030.03712.64
4.3.30.0030.03312.64
4.3.20.0000.03012.64
4.3.10.0030.03012.64
4.3.00.0030.03012.64

preferences:
41.61 ms | 401 KiB | 5 Q