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, '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.0070.01016.75
8.3.50.0060.01216.54
8.3.40.0090.00618.85
8.3.30.0120.00618.69
8.3.20.0050.00318.51
8.3.10.0040.00418.90
8.3.00.0040.00419.18
8.2.180.0090.01218.38
8.2.170.0140.00722.96
8.2.160.0120.00318.82
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0040.00419.53
8.2.110.0100.00020.47
8.2.100.0000.01117.84
8.2.90.0030.00517.84
8.2.80.0040.00417.97
8.2.70.0000.00917.75
8.2.60.0040.00418.03
8.2.50.0030.00517.93
8.2.40.0030.00519.48
8.2.30.0030.00617.77
8.2.20.0040.00517.79
8.2.10.0040.00417.76
8.2.00.0040.00417.75
8.1.280.0100.01025.92
8.1.270.0050.00323.99
8.1.260.0090.00326.35
8.1.250.0050.00328.09
8.1.240.0090.00022.49
8.1.230.0070.00722.81
8.1.220.0040.00417.79
8.1.210.0050.00318.79
8.1.200.0000.00817.36
8.1.190.0000.00817.25
8.1.180.0040.00418.10
8.1.170.0050.00317.62
8.1.160.0070.00019.00
8.1.150.0040.00418.57
8.1.140.0080.00017.52
8.1.130.0050.00219.17
8.1.120.0040.00417.38
8.1.110.0040.00417.38
8.1.100.0070.00017.38
8.1.90.0030.00417.48
8.1.80.0080.00017.47
8.1.70.0030.00317.38
8.1.60.0090.00017.59
8.1.50.0050.00217.41
8.1.40.0000.00817.54
8.1.30.0080.00417.63
8.1.20.0000.00817.57
8.1.10.0040.00417.67
8.1.00.0070.00017.49
8.0.300.0050.00319.96
8.0.290.0040.00416.75
8.0.280.0000.00818.53
8.0.270.0000.00717.33
8.0.260.0000.00616.77
8.0.250.0040.00417.04
8.0.240.0040.00416.97
8.0.230.0040.00416.99
8.0.220.0070.00016.91
8.0.210.0000.00716.88
8.0.200.0030.00316.91
8.0.190.0000.00816.97
8.0.180.0040.00416.83
8.0.170.0030.00716.91
8.0.160.0030.00616.90
8.0.150.0040.00416.82
8.0.140.0000.01116.95
8.0.130.0050.00013.33
8.0.120.0030.00616.79
8.0.110.0030.00317.03
8.0.100.0050.00316.77
8.0.90.0040.00416.84
8.0.80.0130.00916.87
8.0.70.0050.00216.98
8.0.60.0090.00016.85
8.0.50.0040.00416.91
8.0.30.0040.01117.10
8.0.20.0140.00416.96
8.0.10.0080.00016.89
8.0.00.0090.01216.66
7.4.330.0040.00012.92
7.4.320.0000.00616.54
7.4.300.0020.00516.67
7.4.290.0070.00016.63
7.4.280.0040.00416.62
7.4.270.0030.00316.45
7.4.260.0070.00013.35
7.4.250.0030.00616.51
7.4.240.0040.00416.62
7.4.230.0030.00316.64
7.4.220.0060.01216.53
7.4.210.0070.01416.57
7.4.200.0000.00716.58
7.4.190.0000.00816.67
7.4.160.0090.00616.49
7.4.150.0240.02116.45
7.4.140.0080.01317.86
7.4.130.0150.00416.49
7.4.120.0110.00616.50
7.4.110.0070.01616.59
7.4.100.0120.00616.46
7.4.90.0040.01416.42
7.4.80.0080.00819.39
7.4.70.0030.01716.55
7.4.60.0030.01416.60
7.4.50.0000.00416.39
7.4.40.0120.00616.55
7.4.30.0080.00816.49
7.4.00.0030.01315.02
7.3.330.0060.00013.24
7.3.320.0060.00013.35
7.3.310.0040.00416.17
7.3.300.0000.00616.39
7.3.290.0080.00916.33
7.3.280.0070.01116.34
7.3.270.0070.01016.41
7.3.260.0160.01016.56
7.3.240.0120.00416.53
7.3.230.0130.00416.41
7.3.210.0100.00716.45
7.3.200.0090.00716.46
7.3.190.0100.00716.40
7.3.180.0090.00816.63
7.3.170.0110.00716.59
7.3.160.0060.00916.67
7.3.120.0100.00315.12
7.3.10.0120.00316.50
7.3.00.0040.00416.76
7.2.330.0070.01816.55
7.2.320.0120.00616.61
7.2.310.0130.01016.50
7.2.300.0120.00416.79
7.2.290.0090.00816.72
7.2.130.0050.00316.94
7.2.120.0100.00316.65
7.2.110.0000.01217.04
7.2.100.0070.00716.70
7.2.90.0030.00717.03
7.2.80.0040.00816.70
7.2.70.0000.00917.06
7.2.60.0090.00516.83
7.2.50.0120.00316.59
7.2.40.0040.01116.68
7.2.30.0070.00416.91
7.2.20.0000.01417.09
7.2.10.0130.00016.82
7.2.00.0070.00518.16
7.1.250.0030.00915.86
7.1.240.0100.00015.62
7.1.230.0000.01115.58
7.1.220.0080.00815.76
7.1.210.0000.01215.58
7.1.200.0060.00515.78
7.1.190.0080.00015.70
7.1.180.0070.00715.59
7.1.170.0000.01515.80
7.1.160.0030.01015.79
7.1.150.0060.00615.77
7.1.140.0070.00715.70
7.1.130.0030.01015.93
7.1.120.0080.00815.79
7.1.110.0000.00915.92
7.1.100.0030.01016.89
7.1.90.0040.00415.71
7.1.80.0070.00315.73
7.1.70.0030.01116.29
7.1.60.0060.00917.54
7.1.50.0150.01225.26
7.1.40.0070.00715.82
7.1.30.0040.00415.61
7.1.20.0040.00415.54
7.1.10.0090.00315.77
7.1.00.0060.03119.10
7.0.330.0030.00715.25
7.0.320.0090.00615.33
7.0.310.0060.00315.29
7.0.300.0030.01015.17
7.0.290.0000.01515.22
7.0.280.0090.00615.42
7.0.270.0070.00715.26
7.0.260.0030.00915.09
7.0.250.0070.00315.40
7.0.240.0060.00615.20
7.0.230.0030.00615.30
7.0.220.0040.00815.12
7.0.210.0070.00315.27
7.0.200.0020.00916.19
7.0.190.0000.00915.32
7.0.180.0090.00615.30
7.0.170.0070.00615.30
7.0.160.0030.01015.48
7.0.150.0030.00715.18
7.0.140.0090.03718.69
7.0.130.0060.00615.46
7.0.120.0020.04118.75
7.0.110.0030.00715.34
7.0.100.0080.00415.37
7.0.90.0130.00015.32
7.0.80.0090.00615.10
7.0.70.0030.00615.07
7.0.60.0050.04717.70
7.0.50.0070.02716.59
7.0.40.0050.03715.52
7.0.30.0070.03315.65
7.0.20.0050.04815.62
7.0.10.0030.04815.64
7.0.00.0030.04715.54
5.6.380.0000.01514.50
5.6.370.0060.00614.72
5.6.360.0030.00714.23
5.6.350.0070.00714.38
5.6.340.0080.00414.20
5.6.330.0030.00714.56
5.6.320.0000.01514.56
5.6.310.0050.00514.37
5.6.300.0060.00914.39
5.6.290.0030.00614.56
5.6.280.0030.03917.77
5.6.270.0060.00614.12
5.6.260.0040.01114.34
5.6.250.0060.00614.45
5.6.240.0060.00314.35
5.6.230.0030.00714.08
5.6.220.0100.00314.39
5.6.210.0080.03417.53
5.6.200.0030.04616.36
5.6.190.0050.02716.22
5.6.180.0070.02316.21
5.6.170.0060.03816.35
5.6.160.0050.04516.22
5.6.150.0090.04016.21
5.6.140.0070.04316.09
5.6.130.0080.04516.38
5.6.120.0070.04016.21
5.6.110.0020.02716.31
5.6.100.0050.04616.24
5.6.90.0030.02916.26
5.6.80.0000.02715.92
5.6.70.0070.03715.90
5.6.60.0070.04216.04
5.6.50.0030.02515.90
5.6.40.0030.04715.83
5.6.30.0060.02815.96
5.6.20.0000.03415.78
5.6.10.0090.02216.01
5.6.00.0030.02515.88
5.5.380.0040.01111.01
5.5.370.0040.00411.16
5.5.360.0070.00011.40
5.5.350.0130.04015.65
5.5.340.0100.03214.55
5.5.330.0100.04114.64
5.5.320.0050.04314.79
5.5.310.0110.03814.73
5.5.300.0050.04514.51
5.5.290.0070.02714.53
5.5.280.0100.03714.63
5.5.270.0000.02514.44
5.5.260.0030.03614.44
5.5.250.0030.02214.42
5.5.240.0000.04314.38
5.5.230.0080.03714.25
5.5.220.0070.03014.24
5.5.210.0050.04014.24
5.5.200.0060.03614.21
5.5.190.0060.03314.07
5.5.180.0050.02614.38
5.5.170.0000.00710.96
5.5.160.0020.02514.21
5.5.150.0050.04114.32
5.5.140.0070.02214.15
5.5.130.0050.02514.03
5.5.120.0060.04014.40
5.5.110.0080.03814.22
5.5.100.0070.04014.20
5.5.90.0030.04014.18
5.5.80.0030.04014.33
5.5.70.0100.03614.19
5.5.60.0060.02314.24
5.5.50.0080.03614.08
5.5.40.0030.04314.29
5.5.30.0010.04014.31
5.5.20.0080.03814.29
5.5.10.0100.02214.29
5.5.00.0050.04114.17
5.4.450.0060.03715.29
5.4.440.0070.02615.30
5.4.430.0120.03015.31
5.4.420.0050.04515.26
5.4.410.0030.02215.38
5.4.400.0100.03315.01
5.4.390.0030.02515.08
5.4.380.0010.04615.16
5.4.370.0080.03615.14
5.4.360.0020.02615.07
5.4.350.0030.04015.08
5.4.340.0100.03915.04
5.4.330.0000.00711.05
5.4.320.0060.02814.93
5.4.310.0060.04015.11
5.4.300.0060.03815.04
5.4.290.0070.02414.96
5.4.280.0080.03215.09
5.4.270.0050.03214.76
5.4.260.0020.04715.09
5.4.250.0070.03514.99
5.4.240.0030.04514.89
5.4.230.0040.04015.04
5.4.220.0060.02515.00
5.4.210.0050.04014.94
5.4.200.0050.04015.20
5.4.190.0060.02815.17
5.4.180.0020.04615.16
5.4.170.0130.03714.98
5.4.160.0050.02215.07
5.4.150.0060.02215.22
5.4.140.0050.01813.80
5.4.130.0030.02713.91
5.4.120.0030.04013.57
5.4.110.0070.04013.71
5.4.100.0050.02013.79
5.4.90.0070.03813.77
5.4.80.0080.04013.93
5.4.70.0030.04013.59
5.4.60.0050.04313.79
5.4.50.0030.04213.93
5.4.40.0060.03813.96
5.4.30.0080.01613.83
5.4.20.0030.02713.64
5.4.10.0070.03113.72
5.4.00.0050.03513.36
5.3.290.0060.04212.70
5.3.280.0080.04012.57
5.3.270.0060.03312.69
5.3.260.0060.03312.54
5.3.250.0030.03912.62
5.3.240.0030.03012.58
5.3.230.0050.02012.62
5.3.220.0030.03312.60
5.3.210.0020.03612.58
5.3.200.0060.02112.58
5.3.190.0040.04012.54
5.3.180.0050.03312.66
5.3.170.0030.04012.57
5.3.160.0060.02812.64
5.3.150.0060.02512.68
5.3.140.0030.02412.68
5.3.130.0070.03012.71
5.3.120.0120.01912.64
5.3.110.0040.04612.62
5.3.100.0010.02812.38
5.3.90.0050.03212.38
5.3.80.0120.02312.27
5.3.70.0050.02812.06
5.3.60.0050.04012.16
5.3.50.0000.04212.18
5.3.40.0060.03712.24
5.3.30.0050.03212.30
5.3.20.0060.01912.23
5.3.10.0000.03212.11
5.3.00.0000.03712.04
5.2.170.0050.03310.49
5.2.160.0000.02810.32
5.2.150.0040.03410.25
5.2.140.0030.03110.39
5.2.130.0050.02510.33
5.2.120.0030.02510.20
5.2.110.0000.03510.33
5.2.100.0070.02810.32
5.2.90.0060.02810.21
5.2.80.0070.03010.27
5.2.70.0040.03110.16
5.2.60.0060.03210.21
5.2.50.0030.03110.06
5.2.40.0000.03110.26
5.2.30.0120.02710.04
5.2.20.0030.03510.15
5.2.10.0070.02710.03
5.2.00.0050.0309.92
5.1.60.0030.0299.26
5.1.50.0070.0289.31
5.1.40.0020.0229.35
5.1.30.0050.0329.43
5.1.20.0030.0229.51
5.1.10.0030.0219.39
5.1.00.0080.0269.27
5.0.50.0060.0158.42
5.0.40.0020.0168.27
5.0.30.0030.0208.20
5.0.20.0030.0168.10
5.0.10.0020.0178.04
5.0.00.0010.0258.16
4.4.90.0060.0167.82
4.4.80.0020.0187.82
4.4.70.0010.0207.82
4.4.60.0050.0187.82
4.4.50.0050.0157.82
4.4.40.0030.0277.82
4.4.30.0050.0177.82
4.4.20.0030.0187.82
4.4.10.0080.0157.82
4.4.00.0010.0167.82
4.3.110.0030.0147.82
4.3.100.0030.0187.82
4.3.90.0020.0177.82
4.3.80.0030.0277.82
4.3.70.0050.0177.82
4.3.60.0050.0157.82
4.3.50.0030.0207.82
4.3.40.0030.0197.82
4.3.30.0020.0127.82
4.3.20.0020.0167.82
4.3.10.0000.0117.82
4.3.00.0030.0087.82

preferences:
42.48 ms | 401 KiB | 5 Q