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) $results[$lookup], (array) $output[$lookup]); } else { $output[] = array_merge($results, $output); } } } 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.0100.00716.63
8.3.50.0250.00316.53
8.3.40.0110.00418.64
8.3.30.0110.00318.79
8.3.20.0000.00818.69
8.3.10.0050.00318.73
8.3.00.0040.00419.38
8.2.180.0090.00618.41
8.2.170.0170.00322.96
8.2.160.0030.01618.99
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0040.00419.74
8.2.110.0070.00320.24
8.2.100.0060.00617.78
8.2.90.0060.00319.17
8.2.80.0060.00317.97
8.2.70.0110.00417.63
8.2.60.0000.00817.92
8.2.50.0000.00817.93
8.2.40.0040.00419.19
8.2.30.0000.00917.69
8.2.20.0000.00817.88
8.2.10.0040.00417.64
8.2.00.0030.00517.64
8.1.280.0100.01025.92
8.1.270.0090.00023.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0040.00422.05
8.1.230.0060.00617.83
8.1.220.0030.00617.79
8.1.210.0040.00418.77
8.1.200.0060.00317.36
8.1.190.0000.00817.23
8.1.180.0050.00518.10
8.1.170.0040.00417.62
8.1.160.0000.00719.02
8.1.150.0030.00618.53
8.1.140.0030.00517.52
8.1.130.0040.00419.20
8.1.120.0000.00717.37
8.1.110.0040.00417.35
8.1.100.0000.00717.39
8.1.90.0070.00017.39
8.1.80.0040.00417.42
8.1.70.0070.00017.43
8.1.60.0040.00417.60
8.1.50.0040.00417.36
8.1.40.0000.00817.57
8.1.30.0070.00317.64
8.1.20.0030.00617.57
8.1.10.0000.00717.49
8.1.00.0000.00717.51
8.0.300.0000.00718.77
8.0.290.0060.00316.63
8.0.280.0030.00318.53
8.0.270.0000.00717.26
8.0.260.0030.00316.75
8.0.250.0040.00417.00
8.0.240.0040.00416.85
8.0.230.0070.00016.97
8.0.220.0040.00416.80
8.0.210.0090.00016.88
8.0.200.0070.00017.01
8.0.190.0080.00017.02
8.0.180.0040.00416.95
8.0.170.0070.00316.93
8.0.160.0090.00317.04
8.0.150.0000.00716.92
8.0.140.0060.00316.77
8.0.130.0000.00613.33
8.0.120.0000.00816.82
8.0.110.0040.00416.92
8.0.100.0070.00016.78
8.0.90.0040.00416.74
8.0.80.0100.00716.91
8.0.70.0050.00317.04
8.0.60.0040.00416.94
8.0.50.0000.00716.81
8.0.30.0130.00317.14
8.0.20.0150.00417.14
8.0.10.0050.00317.07
8.0.00.0110.00816.63
7.4.330.0050.00013.02
7.4.320.0030.00316.54
7.4.300.0000.00616.46
7.4.290.0070.00016.63
7.4.280.0100.00016.43
7.4.270.0060.00016.58
7.4.260.0000.00513.30
7.4.250.0030.00616.50
7.4.240.0000.00716.53
7.4.230.0030.00316.66
7.4.220.0070.01016.48
7.4.210.0060.01216.58
7.4.200.0070.00016.71
7.4.190.0050.00316.43
7.4.160.0080.00816.56
7.4.150.0120.01216.52
7.4.140.0230.00317.86
7.4.130.0040.01516.65
7.4.120.0060.01116.60
7.4.110.0170.00516.67
7.4.100.0090.00916.45
7.4.90.0070.01116.54
7.4.80.0140.00719.39
7.4.70.0120.00916.43
7.4.60.0080.01116.49
7.4.50.0000.00516.29
7.4.40.0130.00316.47
7.4.30.0040.01216.67
7.4.00.0030.00915.12
7.3.330.0030.00313.42
7.3.320.0030.00313.18
7.3.310.0030.00316.36
7.3.300.0030.00316.25
7.3.290.0030.01216.35
7.3.280.0000.01816.34
7.3.270.0080.00816.58
7.3.260.0030.01416.50
7.3.240.0030.01316.37
7.3.230.0110.00516.27
7.3.210.0060.01216.46
7.3.200.0070.01516.52
7.3.190.0130.00916.41
7.3.180.0070.01016.64
7.3.170.0000.01516.43
7.3.160.0000.01516.55
7.3.120.0050.00914.76
7.3.110.0080.00914.84
7.3.100.0070.00514.89
7.3.90.0000.01214.94
7.3.80.0030.00914.86
7.3.70.0100.00814.80
7.3.60.0080.00214.88
7.3.50.0100.00714.59
7.3.40.0050.00514.89
7.3.30.0020.01214.81
7.3.20.0060.00616.84
7.3.10.0020.01016.56
7.3.00.0080.00316.75
7.2.330.0030.01416.88
7.2.320.0130.01016.85
7.2.310.0100.00716.66
7.2.300.0050.01116.48
7.2.290.0070.01216.91
7.2.240.0070.00815.22
7.2.230.0070.00815.07
7.2.220.0030.00815.10
7.2.210.0060.01115.24
7.2.200.0080.00515.19
7.2.190.0050.01015.04
7.2.180.0050.01214.98
7.2.170.0070.00815.14
7.2.160.0000.01615.05
7.2.150.0050.01216.97
7.2.140.0090.00916.89
7.2.130.0030.01316.94
7.2.120.0060.00816.98
7.2.110.0030.01016.88
7.2.100.0050.00716.85
7.2.90.0050.00917.02
7.2.80.0050.01016.96
7.2.70.0060.00916.96
7.2.60.0040.00916.88
7.2.50.0080.00816.88
7.2.40.0090.00817.10
7.2.30.0020.01616.88
7.2.20.0090.00516.83
7.2.10.0080.00716.85
7.2.00.0080.00716.99
7.1.330.0050.01215.89
7.1.320.0030.00815.88
7.1.310.0030.01115.60
7.1.300.0050.01315.68
7.1.290.0080.00615.84
7.1.280.0040.01115.79
7.1.270.0050.01015.63
7.1.260.0070.00516.00
7.1.250.0000.01216.02
7.1.100.0070.00417.98
7.1.70.0040.00417.20
7.1.60.0140.00319.21
7.1.50.0200.01734.80
7.1.00.0000.05322.36
7.0.200.0030.00616.79
7.0.140.0030.07722.07
7.0.120.0070.05722.13
7.0.60.0270.06019.93
7.0.50.0030.05317.87
7.0.40.0130.06320.17
7.0.30.0070.04320.26
7.0.20.0070.08320.16
7.0.10.0030.08720.10
7.0.00.0000.06020.22
5.6.280.0100.06321.09
5.6.210.0030.04320.61
5.6.200.0070.07718.18
5.6.190.0030.09020.61
5.6.180.0070.04320.57
5.6.170.0030.04320.62
5.6.160.0030.08020.32
5.6.150.0130.08020.40
5.6.140.0030.06320.49
5.6.130.0170.07020.32
5.6.120.0100.04720.23
5.6.110.0030.05020.16
5.6.100.0070.06020.39
5.6.90.0130.06320.30
5.6.80.0070.08719.72
5.6.70.0000.04719.77
5.6.60.0130.08019.74
5.6.50.0000.07719.93
5.6.40.0100.05719.69
5.6.30.0100.06019.88
5.6.20.0070.08019.54
5.6.10.0030.05719.59
5.6.00.0030.04319.68
5.5.350.0070.07720.48
5.5.340.0070.03717.95
5.5.330.0100.08020.27
5.5.320.0130.03720.42
5.5.310.0230.05320.43
5.5.300.0070.04320.20
5.5.290.0030.07320.23
5.5.280.0030.04720.29
5.5.270.0100.06020.27
5.5.260.0100.08320.30
5.5.250.0130.04320.03
5.5.240.0070.06719.36
5.5.230.0070.08019.36
5.5.220.0130.05719.61
5.5.210.0230.06319.58
5.5.200.0100.07019.32
5.5.190.0070.05019.55
5.5.180.0030.04319.64
5.5.160.0070.03719.54
5.5.150.0130.05319.48
5.5.140.0070.04019.57
5.5.130.0030.08319.47
5.5.120.0100.07719.64
5.5.110.0030.04719.31
5.5.100.0100.07319.46
5.5.90.0030.05719.46
5.5.80.0030.05019.38
5.5.70.0100.05319.45
5.5.60.0070.07719.44
5.5.50.0030.04019.47
5.5.40.0070.07719.31
5.5.30.0100.07719.21
5.5.20.0100.05719.46
5.5.10.0030.04019.36
5.5.00.0070.05719.42
5.4.450.0070.06719.47
5.4.440.0070.06019.17
5.4.430.0100.04319.46
5.4.420.0030.05319.47
5.4.410.0100.07319.27
5.4.400.0070.04719.00
5.4.390.0100.07719.11
5.4.380.0100.04719.14
5.4.370.0100.06318.87
5.4.360.0100.04718.85
5.4.350.0070.06019.26
5.4.340.0030.04019.24
5.4.320.0070.03718.85
5.4.310.0070.03719.25
5.4.300.0070.06019.23
5.4.290.0130.07019.19
5.4.280.0030.05019.07
5.4.270.0030.04719.19
5.4.260.0170.03719.11
5.4.250.0100.04718.98
5.4.240.0030.03718.91
5.4.230.0070.07719.15
5.4.220.0070.04319.15
5.4.210.0030.06019.19
5.4.200.0030.03719.23
5.4.190.0000.08318.96
5.4.180.0000.06719.22
5.4.170.0170.06319.14
5.4.160.0070.06319.13
5.4.150.0070.07719.21
5.4.140.0100.07016.46
5.4.130.0100.03716.41
5.4.120.0070.05316.30
5.4.110.0170.04316.45
5.4.100.0070.07316.27
5.4.90.0070.07316.43
5.4.80.0000.04716.27
5.4.70.0070.07016.41
5.4.60.0030.07316.39
5.4.50.0230.05716.52
5.4.40.0000.04716.40
5.4.30.0100.03716.25
5.4.20.0100.07016.38
5.4.10.0030.06316.39
5.4.00.0170.03715.87
5.3.290.0100.03314.82
5.3.280.0100.07014.75
5.3.270.0070.06014.59
5.3.260.0070.06714.66
5.3.250.0130.03714.59
5.3.240.0070.06314.64
5.3.230.0070.07714.63
5.3.220.0070.05314.73
5.3.210.0070.05314.50
5.3.200.0100.07714.70
5.3.190.0030.06714.58
5.3.180.0200.04314.62
5.3.170.0000.04014.56
5.3.160.0070.05314.57
5.3.150.0100.07014.51
5.3.140.0130.07314.61
5.3.130.0070.07314.54
5.3.120.0130.05714.60
5.3.110.0030.07714.57
5.3.100.0000.04013.92
5.3.90.0070.03713.90
5.3.80.0030.03714.01
5.3.70.0000.04014.07
5.3.60.0030.05313.89
5.3.50.0070.06714.11
5.3.40.0030.07713.96
5.3.30.0030.07313.92
5.3.20.0070.06013.70
5.3.10.0070.06313.65
5.3.00.0070.05713.69
5.2.170.0070.06011.16
5.2.160.0030.06711.14
5.2.150.0130.05311.32
5.2.140.0100.06011.19
5.2.130.0030.07011.18
5.2.120.0070.05711.10
5.2.110.0070.02710.98
5.2.100.0000.03711.17
5.2.90.0100.06011.10
5.2.80.0130.05311.02
5.2.70.0000.05011.02
5.2.60.0100.02311.01
5.2.50.0070.03310.93
5.2.40.0130.04010.88
5.2.30.0100.06010.96
5.2.20.0000.05311.00
5.2.10.0100.03010.75
5.2.00.0070.03010.71
5.1.60.0000.05710.04
5.1.50.0030.0579.90
5.1.40.0000.0539.96
5.1.30.0030.05310.38
5.1.20.0030.05310.36
5.1.10.0070.03710.04
5.1.00.0070.05310.02
5.0.50.0070.0438.58
5.0.40.0000.0508.58
5.0.30.0130.0308.23
5.0.20.0030.0408.35
5.0.10.0000.0508.25
5.0.00.0000.0708.31
4.4.90.0070.0305.87
4.4.80.0100.0175.86
4.4.70.0000.0335.86
4.4.60.0000.0375.85
4.4.50.0070.0335.80
4.4.40.0000.0335.79
4.4.30.0030.0235.83
4.4.20.0030.0235.85
4.4.10.0000.0335.90
4.4.00.0000.0505.88
4.3.110.0030.0335.80
4.3.100.0070.0235.74
4.3.90.0000.0235.69
4.3.80.0030.0535.74
4.3.70.0000.0275.77
4.3.60.0030.0335.80
4.3.50.0000.0375.74
4.3.40.0030.0505.66
4.3.30.0000.0305.29
4.3.20.0030.0275.29
4.3.10.0000.0405.29
4.3.00.0000.0235.29

preferences:
62.27 ms | 401 KiB | 5 Q