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[$lookup] = 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.40.0090.00618.75
8.3.30.0100.00718.67
8.3.20.0050.00318.91
8.3.10.0080.00018.70
8.3.00.0050.00319.51
8.2.170.0070.00722.96
8.2.160.0130.00318.79
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0050.00226.16
8.2.120.0080.00019.79
8.2.110.0030.00719.30
8.2.100.0120.00317.72
8.2.90.0050.00319.22
8.2.80.0000.00917.97
8.2.70.0000.00817.75
8.2.60.0080.00018.03
8.2.50.0000.00817.93
8.2.40.0030.00619.35
8.2.30.0060.00317.63
8.2.20.0000.00917.75
8.2.10.0080.00017.64
8.2.00.0040.00417.69
8.1.270.0060.00323.99
8.1.260.0080.00026.35
8.1.250.0080.00028.09
8.1.240.0100.00321.96
8.1.230.0060.00617.77
8.1.220.0050.00317.78
8.1.210.0040.00418.77
8.1.200.0060.00317.25
8.1.190.0040.00417.22
8.1.180.0030.00518.10
8.1.170.0030.00517.62
8.1.160.0050.00319.08
8.1.150.0000.00818.66
8.1.140.0040.00417.52
8.1.130.0000.00719.28
8.1.120.0000.00717.40
8.1.110.0080.00017.47
8.1.100.0030.00317.42
8.1.90.0070.00017.54
8.1.80.0000.00717.38
8.1.70.0070.00017.46
8.1.60.0050.00317.55
8.1.50.0030.00517.49
8.1.40.0080.00017.51
8.1.30.0000.01117.57
8.1.20.0040.00417.66
8.1.10.0000.00817.65
8.1.00.0030.00517.52
8.0.300.0040.00418.77
8.0.290.0030.00616.63
8.0.280.0040.00418.46
8.0.270.0070.00017.20
8.0.260.0030.00316.71
8.0.250.0000.00816.84
8.0.240.0070.00016.86
8.0.230.0050.00316.88
8.0.220.0050.00316.94
8.0.210.0050.00516.80
8.0.200.0060.00016.84
8.0.190.0000.00716.87
8.0.180.0040.00416.92
8.0.170.0030.00616.94
8.0.160.0030.00716.88
8.0.150.0030.00616.86
8.0.140.0030.00616.84
8.0.130.0030.00313.30
8.0.120.0080.00016.78
8.0.110.0040.00416.90
8.0.100.0050.00516.79
8.0.90.0040.00416.77
8.0.80.0150.00616.95
8.0.70.0050.00216.91
8.0.60.0080.00016.82
8.0.50.0050.00316.82
8.0.30.0030.01217.23
8.0.20.0120.00817.13
8.0.10.0040.00417.08
8.0.00.0090.01016.72
7.4.330.0020.00213.02
7.4.320.0000.00716.65
7.4.300.0070.00016.49
7.4.290.0030.00316.63
7.4.280.0060.00316.50
7.4.270.0050.00216.43
7.4.260.0050.00013.33
7.4.250.0030.00616.59
7.4.240.0040.00416.57
7.4.230.0070.00016.65
7.4.220.0060.01616.61
7.4.210.0030.01216.51
7.4.200.0070.00016.50
7.4.190.0000.00816.70
7.4.160.0070.01516.46
7.4.150.0150.00316.47
7.4.140.0170.00317.86
7.4.130.0180.00016.67
7.4.120.0090.01216.57
7.4.110.0070.01116.59
7.4.100.0110.00816.70
7.4.90.0130.00416.38
7.4.80.0090.01419.39
7.4.70.0050.01116.40
7.4.60.0070.01416.41
7.4.50.0050.00016.40
7.4.40.0030.01416.55
7.4.30.0040.01216.67
7.4.00.0050.01115.07
7.3.330.0030.00313.43
7.3.320.0040.00413.32
7.3.310.0070.00016.23
7.3.300.0030.00316.26
7.3.290.0080.00816.35
7.3.280.0070.00716.39
7.3.270.0120.00616.71
7.3.260.0090.00916.74
7.3.240.0110.00616.67
7.3.230.0110.00616.27
7.3.210.0160.00616.34
7.3.200.0120.00316.38
7.3.190.0040.01116.33
7.3.180.0060.01216.62
7.3.170.0160.00016.51
7.3.160.0110.01116.37
7.3.120.0060.01214.94
7.3.110.0040.01514.79
7.3.100.0100.00314.99
7.3.90.0040.01114.84
7.3.80.0120.00614.96
7.3.70.0000.01214.75
7.3.60.0090.00614.82
7.3.50.0130.00314.85
7.3.40.0030.01214.42
7.3.30.0070.01014.61
7.3.20.0040.01116.77
7.3.10.0040.01116.50
7.3.00.0030.01016.33
7.2.330.0000.02216.54
7.2.320.0130.01016.71
7.2.310.0150.00316.71
7.2.300.0090.01216.59
7.2.290.0140.00316.73
7.2.250.0090.01214.98
7.2.240.0030.01715.20
7.2.230.0060.01015.18
7.2.220.0030.01015.21
7.2.210.0060.00915.13
7.2.200.0070.00715.09
7.2.190.0060.01015.07
7.2.180.0100.00715.23
7.2.170.0070.00715.10
7.2.80.0070.00716.69
7.2.60.0040.00816.88
7.2.00.0060.00619.38
7.1.330.0040.01115.53
7.1.320.0120.00015.73
7.1.310.0030.01315.56
7.1.300.0070.01115.79
7.1.290.0090.00315.65
7.1.280.0040.00715.70
7.1.270.0030.01215.69
7.1.260.0100.00315.89
7.1.200.0040.00715.62
7.1.100.0000.01418.19
7.1.70.0030.00517.26
7.1.60.0060.01319.21
7.1.50.0100.01316.86
7.1.00.0000.05722.26
7.0.200.0090.00316.88
7.0.140.0070.07022.09
7.0.120.0000.07322.05
7.0.60.0030.08019.86
7.0.50.0100.07317.90
7.0.40.0170.06317.76
7.0.30.0030.06717.77
7.0.20.0070.04317.72
7.0.10.0100.07017.75
7.0.00.0070.06017.75
5.6.280.0000.07321.10
5.6.210.0100.07720.62
5.6.200.0100.05018.19
5.6.190.0070.08018.15
5.6.180.0100.04318.25
5.6.170.0100.08018.23
5.6.160.0030.04018.18
5.6.150.0100.04018.12
5.6.140.0070.08018.24
5.6.130.0100.04718.16
5.6.120.0200.04318.25
5.6.110.0000.07318.18
5.6.100.0100.06018.16
5.6.90.0030.05718.13
5.6.80.0070.05017.58
5.6.70.0070.04317.60
5.6.60.0030.08317.62
5.6.50.0100.04317.65
5.6.40.0030.04317.57
5.6.30.0030.04017.55
5.6.20.0030.03717.54
5.6.10.0000.04017.60
5.6.00.0000.04017.53
5.5.350.0170.05720.43
5.5.340.0070.04717.94
5.5.330.0130.06718.09
5.5.320.0030.05017.94
5.5.310.0070.08017.95
5.5.300.0100.07017.95
5.5.290.0070.08317.97
5.5.280.0130.05017.95
5.5.270.0030.08317.95
5.5.260.0170.04717.97
5.5.250.0170.06317.86
5.5.240.0030.05317.34
5.5.230.0100.08717.46
5.5.220.0030.08017.33
5.5.210.0130.04317.36
5.5.200.0030.03717.44
5.5.190.0000.04017.30
5.5.180.0030.04017.44
5.5.160.0000.04017.36
5.5.150.0000.04017.44
5.5.140.0070.03717.41
5.5.130.0030.07317.33
5.5.120.0030.07717.33
5.5.110.0030.04017.30
5.5.100.0070.05017.30
5.5.90.0070.03717.23
5.5.80.0000.04017.17
5.5.70.0030.04017.31
5.5.60.0030.03717.25
5.5.50.0030.03717.23
5.5.40.0030.03717.16
5.5.30.0070.03717.23
5.5.20.0030.03717.29
5.5.10.0030.03717.20
5.5.00.0000.04017.30
5.4.450.0170.06719.43
5.4.440.0130.03719.22
5.4.430.0100.07319.59
5.4.420.0070.04319.37
5.4.410.0030.07319.21
5.4.400.0000.07318.99
5.4.390.0100.08019.04
5.4.380.0100.07319.10
5.4.370.0130.04019.04
5.4.360.0100.03319.09
5.4.350.0070.03319.12
5.4.340.0030.04319.09
5.4.320.0030.04319.09
5.4.310.0070.03719.01
5.4.300.0000.04019.05
5.4.290.0070.03719.01
5.4.280.0070.05019.03
5.4.270.0000.05719.11
5.4.260.0070.06718.95
5.4.250.0030.03718.96
5.4.240.0070.03318.88
5.4.230.0000.05019.04
5.4.220.0070.03318.98
5.4.210.0070.03319.13
5.4.200.0070.03319.00
5.4.190.0030.03718.96
5.4.180.0030.03719.02
5.4.170.0100.03018.98
5.4.160.0030.03719.03
5.4.150.0030.04718.87
5.4.140.0030.05716.40
5.4.130.0000.03716.39
5.4.120.0000.04016.35
5.4.110.0070.04316.58
5.4.100.0000.03716.41
5.4.90.0030.04716.59
5.4.80.0030.03316.31
5.4.70.0070.07016.44
5.4.60.0070.05316.36
5.4.50.0030.03716.42
5.4.40.0070.06016.29
5.4.30.0030.05716.38
5.4.20.0030.08016.38
5.4.10.0030.06716.30
5.4.00.0170.06315.73
5.3.290.0000.04014.71
5.3.280.0030.03714.66
5.3.270.0000.04014.57
5.3.260.0030.03714.57
5.3.250.0000.04314.65
5.3.240.0070.03314.60
5.3.230.0000.04014.61
5.3.220.0000.04014.58
5.3.210.0030.03714.53
5.3.200.0000.04314.59
5.3.190.0000.04014.52
5.3.180.0030.03314.52
5.3.170.0030.05014.61
5.3.160.0000.05314.57
5.3.150.0100.07314.56
5.3.140.0000.08314.68
5.3.130.0070.04314.58
5.3.120.0100.07714.40
5.3.110.0100.07714.62
5.3.100.0030.05314.07
5.3.90.0000.06014.06
5.3.80.0070.08014.05
5.3.70.0030.05314.01
5.3.60.0070.06014.02
5.3.50.0030.04014.16
5.3.40.0000.07013.84
5.3.30.0070.06313.96
5.3.20.0070.03313.79
5.3.10.0000.04013.64
5.3.00.0070.03713.66
5.2.170.0030.04311.20
5.2.160.0030.03711.15
5.2.150.0100.05011.36
5.2.140.0030.03710.99
5.2.130.0000.06311.17
5.2.120.0070.06011.07
5.2.110.0070.02711.10
5.2.100.0030.03711.31
5.2.90.0070.06011.20
5.2.80.0030.03311.19
5.2.70.0100.04311.16
5.2.60.0000.07011.27
5.2.50.0030.06011.06
5.2.40.0000.04311.01
5.2.30.0030.04010.98
5.2.20.0070.05710.86
5.2.10.0070.05310.90
5.2.00.0030.03010.71
5.1.60.0030.05710.07
5.1.50.0070.05010.07
5.1.40.0130.0279.95
5.1.30.0000.05710.39
5.1.20.0130.04710.26
5.1.10.0030.05710.10
5.1.00.0000.06010.07
5.0.50.0100.0408.61
5.0.40.0000.0308.49
5.0.30.0000.0338.07
5.0.20.0000.0508.17
5.0.10.0030.0308.15
5.0.00.0000.0408.17
4.4.90.0000.0377.71
4.4.80.0030.0307.71
4.4.70.0000.0237.71
4.4.60.0070.0337.71
4.4.50.0030.0337.71
4.4.40.0000.0277.71
4.4.30.0030.0237.71
4.4.20.0000.0207.71
4.4.10.0000.0307.71
4.4.00.0070.0237.71
4.3.110.0030.0177.71
4.3.100.0070.0307.71
4.3.90.0030.0307.71
4.3.80.0000.0477.71
4.3.70.0000.0377.71
4.3.60.0030.0337.71
4.3.50.0000.0337.71
4.3.40.0070.0507.71
4.3.30.0000.0407.71
4.3.20.0000.0377.71
4.3.10.0070.0337.71
4.3.00.0000.0207.71

preferences:
49.52 ms | 400 KiB | 5 Q