3v4l.org

run code in 300+ PHP versions simultaneously
<?php function coolPluck($array, $lookup) { $output = array(); foreach($array as $k => $v) { if($k === $lookup && (isset($array[$k]))) { $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]); var_dump($output); } else { $output = array_merge($results, $output); var_dump($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.40.0080.00818.70
8.3.30.0110.00718.70
8.3.20.0040.00418.73
8.3.10.0060.00318.91
8.3.00.0050.00319.38
8.2.170.0110.00722.96
8.2.160.0130.00618.96
8.2.150.0060.00324.18
8.2.140.0150.00024.66
8.2.130.0080.00026.16
8.2.120.0040.00419.66
8.2.110.0060.00621.04
8.2.100.0000.01118.03
8.2.90.0080.00019.41
8.2.80.0080.00017.97
8.2.70.0000.01217.63
8.2.60.0000.00817.93
8.2.50.0040.00418.05
8.2.40.0100.00019.35
8.2.30.0060.00317.79
8.2.20.0030.00617.76
8.2.10.0000.00717.89
8.2.00.0040.00417.77
8.1.270.0030.00523.99
8.1.260.0030.00626.35
8.1.250.0050.00328.09
8.1.240.0030.00622.64
8.1.230.0040.00717.76
8.1.220.0040.00417.74
8.1.210.0080.00018.77
8.1.200.0040.00417.35
8.1.190.0080.00017.35
8.1.180.0040.00418.10
8.1.170.0000.00817.62
8.1.160.0000.00719.07
8.1.150.0050.00218.73
8.1.140.0060.00317.55
8.1.130.0070.00019.17
8.1.120.0000.00817.47
8.1.110.0050.00217.40
8.1.100.0000.00717.51
8.1.90.0040.00417.47
8.1.80.0000.00917.38
8.1.70.0000.00817.48
8.1.60.0030.00617.63
8.1.50.0040.00417.44
8.1.40.0000.00717.59
8.1.30.0070.00417.66
8.1.20.0060.00617.67
8.1.10.0040.00417.66
8.1.00.0030.00517.56
8.0.300.0040.00418.77
8.0.290.0000.00716.73
8.0.280.0070.00018.61
8.0.270.0030.00517.35
8.0.260.0000.00816.86
8.0.250.0070.00016.93
8.0.240.0040.00417.00
8.0.230.0000.00816.90
8.0.220.0080.00016.94
8.0.210.0040.00416.83
8.0.200.0030.00616.89
8.0.190.0040.00417.01
8.0.180.0040.00416.99
8.0.170.0060.00316.94
8.0.160.0080.00416.89
8.0.150.0040.00416.88
8.0.140.0030.00516.90
8.0.130.0050.00013.35
8.0.120.0050.00516.71
8.0.110.0000.00716.75
8.0.100.0050.00316.80
8.0.90.0030.00616.99
8.0.80.0040.01816.88
8.0.70.0040.00417.05
8.0.60.0040.00416.87
8.0.50.0000.00716.82
8.0.30.0120.00917.31
8.0.20.0060.01217.19
8.0.10.0080.00017.09
8.0.00.0120.00816.69
7.4.330.0060.00012.97
7.4.320.0000.00716.54
7.4.300.0030.00316.64
7.4.290.0030.00316.61
7.4.280.0000.00916.60
7.4.270.0030.00316.56
7.4.260.0060.00013.25
7.4.250.0000.00816.52
7.4.240.0030.00316.56
7.4.230.0030.00316.59
7.4.220.0120.00916.46
7.4.210.0070.01416.73
7.4.200.0070.00016.48
7.4.190.0040.00416.50
7.4.160.0110.00516.54
7.4.150.0030.01616.52
7.4.140.0130.00617.86
7.4.130.0140.01216.54
7.4.120.0090.01216.63
7.4.110.0170.00316.57
7.4.100.0160.00416.45
7.4.90.0090.00916.52
7.4.80.0150.00819.39
7.4.70.0110.00716.60
7.4.60.0070.01316.55
7.4.50.0060.00316.50
7.4.40.0100.00716.28
7.4.30.0000.01716.52
7.4.10.0120.00814.83
7.4.00.0090.00715.00
7.3.330.0030.00313.26
7.3.320.0030.00313.18
7.3.310.0030.00316.39
7.3.300.0030.00316.34
7.3.290.0070.00916.38
7.3.280.0000.01416.30
7.3.270.0100.00716.61
7.3.260.0140.00416.79
7.3.240.0060.01016.46
7.3.230.0030.01316.56
7.3.210.0110.00716.68
7.3.200.0140.00616.66
7.3.190.0030.01316.45
7.3.180.0100.00716.41
7.3.170.0120.00816.41
7.3.160.0070.01016.33
7.3.130.0080.00914.96
7.3.120.0060.01315.01
7.3.110.0090.00914.92
7.3.100.0070.00714.98
7.3.90.0090.00814.82
7.3.80.0060.00614.73
7.3.70.0050.00614.73
7.3.60.0130.00214.89
7.3.50.0050.01214.89
7.3.40.0070.00414.80
7.3.30.0060.00814.70
7.3.20.0100.00516.85
7.3.10.0060.00816.74
7.3.00.0040.00616.79
7.2.330.0090.01216.75
7.2.320.0120.00916.74
7.2.310.0130.01016.75
7.2.300.0070.01016.70
7.2.290.0150.00416.75
7.2.260.0100.00914.91
7.2.250.0080.01115.18
7.2.240.0050.01115.03
7.2.230.0100.00515.11
7.2.220.0030.01215.26
7.2.210.0070.00714.98
7.2.200.0050.01214.97
7.2.190.0100.00615.01
7.2.180.0030.01015.08
7.2.170.0040.00915.22
7.2.160.0080.00815.20
7.2.150.0060.00717.03
7.2.140.0070.00516.93
7.2.130.0060.01016.92
7.2.120.0040.00916.93
7.2.110.0050.00716.86
7.2.100.0050.00716.92
7.2.90.0030.00917.05
7.2.80.0030.01016.94
7.2.70.0070.00816.96
7.2.60.0050.01116.97
7.2.50.0040.01016.85
7.2.40.0040.01016.81
7.2.30.0070.00616.96
7.2.20.0020.01116.90
7.2.10.0060.00916.71
7.2.00.0070.00617.56
7.1.330.0070.00915.74
7.1.320.0100.00515.44
7.1.310.0060.00815.88
7.1.300.0060.00715.81
7.1.290.0030.00815.71
7.1.280.0030.00715.71
7.1.270.0080.00715.76
7.1.260.0030.00815.79
7.1.250.0030.00915.77
7.1.240.0050.00715.78
7.1.230.0020.01215.87
7.1.220.0020.01015.80
7.1.210.0030.00915.74
7.1.200.0050.00715.82
7.1.190.0060.00915.88
7.1.180.0060.01015.72
7.1.170.0050.00815.67
7.1.160.0020.01115.79
7.1.150.0040.01115.89
7.1.140.0090.00415.71
7.1.130.0060.01015.84
7.1.120.0070.00515.86
7.1.110.0040.00815.83
7.1.100.0030.01016.60
7.1.90.0020.00715.73
7.1.80.0060.00815.83
7.1.70.0060.00816.33
7.1.60.0050.00716.21
7.1.50.0080.00716.15
7.1.40.0030.00815.71
7.1.30.0050.00915.72
7.1.20.0040.00815.78
7.1.10.0020.01215.81
7.1.00.0070.01717.89
7.0.330.0030.01015.46
7.0.320.0000.01115.34
7.0.310.0020.01115.39
7.0.300.0060.00515.50
7.0.290.0040.01015.24
7.0.280.0090.00615.41
7.0.270.0030.00815.45
7.0.260.0040.00915.52
7.0.250.0030.01015.45
7.0.240.0070.00515.50
7.0.230.0050.00815.31
7.0.220.0040.00915.37
7.0.210.0090.00315.41
7.0.200.0050.00915.96
7.0.190.0100.00415.36
7.0.180.0090.00415.56
7.0.170.0080.00615.54
7.0.160.0050.00615.48
7.0.150.0060.00615.37
7.0.140.0030.02917.56
7.0.130.0020.00915.47
7.0.120.0030.01817.58
7.0.110.0060.00915.34
7.0.100.0080.00615.49
7.0.90.0090.00515.51
7.0.80.0100.00615.30
7.0.70.0050.00615.55
7.0.60.0050.03217.06
7.0.50.0120.02816.24
7.0.40.0130.03015.78
7.0.30.0140.03115.63
7.0.20.0100.01515.67
7.0.10.0090.03015.68
7.0.00.0060.02115.67
5.6.400.0050.00714.49
5.6.390.0050.00914.43
5.6.380.0020.01314.39
5.6.370.0050.00614.43
5.6.360.0020.01114.57
5.6.350.0050.00614.51
5.6.340.0090.00514.54
5.6.330.0040.01114.30
5.6.320.0060.00814.70
5.6.310.0070.00714.65
5.6.300.0080.00714.42
5.6.290.0030.00914.52
5.6.280.0080.02316.61
5.6.270.0070.00714.49
5.6.260.0010.00714.38
5.6.250.0020.00714.51
5.6.240.0040.00814.36
5.6.230.0030.01214.36
5.6.220.0000.01114.45
5.6.210.0070.03116.35
5.6.200.0110.02115.66
5.6.190.0080.03316.58
5.6.180.0100.03416.34
5.6.170.0120.03016.33
5.6.160.0040.02316.39
5.6.150.0030.02215.58
5.6.140.0050.03315.54
5.6.130.0040.02415.71
5.6.120.0090.02916.69
5.6.110.0030.03516.65
5.6.100.0070.03016.53
5.6.90.0100.02916.47
5.6.80.0050.03216.37
5.6.70.0120.03116.49
5.6.60.0050.00714.54
5.6.50.0060.00814.29
5.6.40.0100.00414.30
5.6.30.0030.00714.41
5.6.20.0050.00714.26
5.6.10.0060.00914.16
5.6.00.0090.00614.20
5.5.380.0050.01314.05
5.5.370.0050.00714.25
5.5.360.0070.00714.12
5.5.350.0100.01216.30
5.5.340.0080.03215.60
5.5.330.0050.02116.25
5.5.320.0220.02816.36
5.5.310.0140.02016.26
5.5.300.0100.02815.54
5.5.290.0020.02315.62
5.5.280.0030.02016.50
5.5.270.0060.01916.42
5.5.260.0020.02016.45
5.5.250.0040.03416.29
5.5.240.0090.02416.21
5.5.230.0040.01014.14
5.5.220.0010.01214.17
5.5.210.0040.01214.34
5.5.200.0030.01014.24
5.5.190.0060.00814.10
5.5.180.0070.00514.20
5.5.170.0090.00514.05
5.5.160.0030.01214.40
5.5.150.0120.00314.48
5.5.140.0040.00614.17
5.5.130.0040.00914.30
5.5.120.0060.00614.33
5.5.110.0030.00914.55
5.5.100.0030.00814.36
5.5.90.0070.00514.39
5.5.80.0040.00814.14
5.5.70.0050.00714.29
5.5.60.0050.00914.36
5.5.50.0070.00914.21
5.5.40.0030.01114.25
5.5.30.0050.00714.28
5.5.20.0100.00414.30
5.5.10.0020.01114.37
5.5.00.0110.00514.29
5.4.450.0090.01714.52
5.4.440.0160.02414.58
5.4.430.0080.01714.54
5.4.420.0050.02114.55
5.4.410.0070.01814.37
5.4.400.0070.01714.29
5.4.390.0130.01314.47
5.4.380.0100.01514.28
5.4.370.0120.02514.28
5.4.360.0060.03214.47
5.4.350.0120.02414.49
5.4.340.0140.02314.48
5.4.330.0040.00412.08
5.4.320.0120.02814.35
5.4.310.0120.01914.45
5.4.300.0110.02114.49
5.4.290.0090.01914.33
5.4.280.0120.01514.40
5.4.270.0100.02614.45
5.4.260.0110.02514.39
5.4.250.0110.02514.49
5.4.240.0110.01014.38
5.4.230.0090.01514.36
5.4.220.0100.02714.38
5.4.210.0130.02614.45
5.4.200.0090.01714.45
5.4.190.0110.02214.36
5.4.180.0070.02114.47
5.4.170.0130.02714.28
5.4.160.0150.02114.29
5.4.150.0120.02014.43
5.4.140.0090.01513.61
5.4.130.0130.02213.50
5.4.120.0100.02113.55
5.4.110.0140.02213.51
5.4.100.0080.01913.52
5.4.90.0070.01913.60
5.4.80.0060.01813.58
5.4.70.0080.02013.52
5.4.60.0120.02913.44
5.4.50.0150.02113.56
5.4.40.0080.02213.58
5.4.30.0120.01913.49
5.4.20.0130.02313.32
5.4.10.0120.02213.51
5.4.00.0070.02013.25
5.3.290.0210.01812.69
5.3.280.0160.01312.58
5.3.270.0130.02912.76
5.3.260.0100.02212.77
5.3.250.0090.02112.67
5.3.240.0090.01712.66
5.3.230.0130.01912.70
5.3.220.0100.02712.72
5.3.210.0150.01912.71
5.3.200.0130.02212.71
5.3.190.0080.02212.77
5.3.180.0140.02112.73
5.3.170.0090.02012.79
5.3.160.0130.01612.65
5.3.150.0110.01912.64
5.3.140.0120.02312.72
5.3.130.0160.01812.76
5.3.120.0050.02512.75
5.3.110.0100.02612.68
5.3.100.0100.02312.61
5.3.90.0190.02112.62
5.3.80.0110.01712.50
5.3.70.0120.02312.55
5.3.60.0130.02412.53
5.3.50.0150.01812.40
5.3.40.0110.01612.54
5.3.30.0130.02112.55
5.3.20.0110.02612.43
5.3.10.0170.02512.26
5.3.00.0120.02512.32
5.2.170.0170.03712.18
5.2.160.0100.03312.18
5.2.150.0300.03712.18
5.2.140.0200.04312.18
5.2.130.0200.05012.18
5.2.120.0200.03312.18
5.2.110.0200.03312.18
5.2.100.0230.03312.18
5.2.90.0100.05012.18
5.2.80.0200.03712.18
5.2.70.0130.04012.18
5.2.60.0200.03712.18
5.2.50.0170.04312.18
5.2.40.0100.03312.18
5.2.30.0130.04012.18
5.2.20.0130.03712.18
5.2.10.0170.04712.18
5.2.00.0130.04312.18
5.1.60.0170.03012.18
5.1.50.0100.05712.18
5.1.40.0130.04012.18
5.1.30.0270.04312.18
5.1.20.0200.05012.18
5.1.10.0170.05312.18
5.1.00.0230.05012.18
5.0.50.0100.04312.18
5.0.40.0100.04312.18
5.0.30.0100.05312.18
5.0.20.0030.05012.18
5.0.10.0130.04012.18
5.0.00.0100.06312.18
4.4.90.0030.03012.18
4.4.80.0130.02312.18
4.4.70.0130.03312.18
4.4.60.0070.03712.18
4.4.50.0070.03712.18
4.4.40.0100.04312.18
4.4.30.0100.02312.18
4.4.20.0070.02012.18
4.4.10.0170.03312.18
4.4.00.0170.03312.18
4.3.110.0070.02712.18
4.3.100.0070.03312.18
4.3.90.0130.02012.18
4.3.80.0100.05012.18
4.3.70.0100.03012.18
4.3.60.0100.03012.18
4.3.50.0070.03012.18
4.3.40.0130.04712.18
4.3.30.0070.03712.18
4.3.20.0070.03712.18
4.3.10.0070.03712.18
4.3.00.0100.02012.18

preferences:
42.99 ms | 400 KiB | 5 Q