3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Examples 1 & 2 from http://nl3.php.net/array_column $records = array( 4 => array( 'id' => 2135, 'first_name' => 'John', 'last_name' => 'Doe', ), 8 => array( 'id' => 3245, 'first_name' => 'Sally', 'last_name' => 'Smith', ), 2 => array( 'id' => 5342, 'first_name' => 'Jane', 'last_name' => 'Jones', ), '00013411' => array( 'id' => 5623, 'first_name' => 'Peter', 'last_name' => 'Doe', ) ); // Example 1: original indexes are lost =( print_r(array_column($records, 'first_name')); // Example 2: new indexes are 'id' column print_r(array_column($records, 'last_name', 'id')); // Example 3: full objects by 'last_name' print_r(array_column($records, null, 'last_name')); // Example 4: objects instead of arrays? $objects = array_map(function($arr) { return (object)$arr; }, $records); print_r(array_column($records, 'last_name', 'id'));

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.0140.00318.32
8.3.50.0100.00521.09
8.3.40.0120.00318.67
8.3.30.0040.01119.10
8.3.20.0080.00020.34
8.3.10.0070.00022.08
8.3.00.0050.00322.52
8.2.180.0120.00616.35
8.2.170.0000.01422.96
8.2.160.0070.01019.08
8.2.150.0080.00024.18
8.2.140.0080.00024.66
8.2.130.0160.00326.16
8.2.120.0040.00419.63
8.2.110.0030.00620.52
8.2.100.0080.00319.21
8.2.90.0000.00719.17
8.2.80.0000.00818.03
8.2.70.0040.00417.63
8.2.60.0060.00317.80
8.2.50.0040.00418.07
8.2.40.0050.00318.03
8.2.30.0000.00818.04
8.2.20.0050.00217.68
8.2.10.0080.00017.82
8.2.00.0050.00217.82
8.1.280.0070.00725.92
8.1.270.0040.00420.46
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0060.00323.91
8.1.230.0120.00019.09
8.1.220.0090.00017.74
8.1.210.0040.00418.77
8.1.200.0090.00017.35
8.1.190.0040.00417.53
8.1.180.0030.00518.73
8.1.170.0100.00018.64
8.1.160.0030.00522.02
8.1.150.0040.00418.58
8.1.140.0070.00017.39
8.1.130.0060.00317.86
8.1.120.0000.00717.46
8.1.110.0020.00517.40
8.1.100.0030.00317.50
8.1.90.0070.00017.39
8.1.80.0030.00317.50
8.1.70.0060.00017.41
8.1.60.0000.01117.52
8.1.50.0080.00017.46
8.1.40.0040.00417.51
8.1.30.0080.00017.67
8.1.20.0030.00517.68
8.1.10.0000.00917.50
8.1.00.0000.00717.32
8.0.300.0040.00418.77
8.0.290.0040.00417.05
8.0.280.0000.00718.41
8.0.270.0040.00417.21
8.0.260.0030.00316.70
8.0.250.0000.00716.95
8.0.240.0000.00916.90
8.0.230.0030.00316.80
8.0.220.0000.00716.93
8.0.210.0050.00316.77
8.0.200.0000.00717.00
8.0.190.0050.00316.96
8.0.180.0050.00316.91
8.0.170.0030.00516.92
8.0.160.0030.00516.96
8.0.150.0000.00716.93
8.0.140.0050.00216.90
8.0.130.0060.00013.46
8.0.120.0000.00816.91
8.0.110.0040.00416.92
8.0.100.0040.00416.84
8.0.90.0040.00416.87
8.0.80.0130.00616.87
8.0.70.0040.00417.04
8.0.60.0000.00816.75
8.0.50.0000.00816.72
8.0.30.0060.01317.12
8.0.20.0120.00717.40
8.0.10.0040.00417.04
8.0.00.0120.01116.75
7.4.330.0030.00315.00
7.4.320.0000.00716.50
7.4.300.0000.00716.59
7.4.290.0060.00316.70
7.4.280.0030.00316.61
7.4.270.0000.00816.51
7.4.260.0030.00316.52
7.4.250.0000.00816.55
7.4.240.0050.00216.59
7.4.230.0030.00316.63
7.4.220.0130.00616.49
7.4.210.0100.00716.61
7.4.200.0040.00416.66
7.4.190.0030.00316.56
7.4.160.0140.00316.39
7.4.150.0130.00317.40
7.4.140.0150.00617.86
7.4.130.0080.00816.49
7.4.120.0120.00616.53
7.4.110.0130.00316.55
7.4.100.0090.01516.54
7.4.90.0100.00716.60
7.4.80.0100.00719.39
7.4.70.0190.00016.67
7.4.60.0060.01116.56
7.4.50.0000.00916.38
7.4.40.0050.00522.77
7.4.30.0070.01016.43
7.4.00.0030.01014.91
7.3.330.0020.00213.20
7.3.320.0000.00513.27
7.3.310.0040.00416.21
7.3.300.0000.00716.23
7.3.290.0100.01016.34
7.3.280.0090.01016.28
7.3.270.0100.01317.40
7.3.260.0090.00916.69
7.3.250.0060.01116.60
7.3.240.0040.01416.34
7.3.230.0160.00016.49
7.3.210.0090.00916.24
7.3.200.0060.01319.39
7.3.190.0170.00016.34
7.3.180.0030.01316.43
7.3.170.0090.00616.46
7.3.160.0080.00816.69
7.3.120.0070.00414.91
7.3.10.0020.01016.59
7.3.00.0070.00716.60
7.2.330.0120.00616.43
7.2.320.0070.01116.65
7.2.310.0030.01316.46
7.2.300.0060.01516.32
7.2.290.0130.00816.36
7.2.130.0040.00916.83
7.2.120.0050.00916.88
7.2.110.0060.00816.94
7.2.100.0050.01017.06
7.2.90.0050.00817.02
7.2.80.0070.00916.95
7.2.70.0070.00516.88
7.2.60.0060.00816.99
7.2.50.0050.00516.74
7.2.40.0060.00616.94
7.2.30.0070.00916.90
7.2.20.0060.00616.87
7.2.10.0090.00316.90
7.2.00.0090.00417.69
7.1.250.0060.00615.82
7.1.100.0030.00718.10
7.1.70.0000.00917.20
7.1.60.0060.01319.82
7.1.50.0070.01417.04
7.1.00.0070.03322.34
7.0.200.0040.00416.90
7.0.140.0070.07022.18
7.0.100.0500.04319.88
7.0.90.0430.08019.97
7.0.80.0200.08719.93
7.0.70.0470.04319.96
7.0.60.0370.08019.99
7.0.50.0470.08320.35
7.0.40.0100.08019.95
7.0.30.0030.07720.15
7.0.20.0070.07019.95
7.0.10.0130.07020.14
7.0.00.0070.08320.05
5.6.280.0030.07321.12
5.6.250.0130.07320.71
5.6.240.0130.05320.68
5.6.230.0070.07020.62
5.6.220.0100.07720.55
5.6.210.0100.06720.73
5.6.200.0170.04721.14
5.6.190.0200.06320.95
5.6.180.0030.08320.96
5.6.170.0130.07721.09
5.6.160.0070.08321.11
5.6.150.0070.08721.12
5.6.140.0100.08321.03
5.6.130.0100.07720.95
5.6.120.0070.08321.14
5.6.110.0170.06021.11
5.6.100.0030.08021.11
5.6.90.0130.08021.07
5.6.80.0170.07020.41
5.6.70.0070.07720.43
5.6.60.0070.05720.41
5.6.50.0030.07720.43
5.6.40.0000.06020.50
5.6.30.0200.06720.40
5.6.20.0100.07320.31
5.6.10.0100.07720.46
5.6.00.0100.04720.36
5.5.380.0070.08020.44
5.5.370.0030.07020.36
5.5.360.0070.05020.34
5.5.350.0100.08020.45
5.5.340.0070.08020.89
5.5.330.0230.06720.94
5.5.320.0100.04720.81
5.5.310.0130.07720.74
5.5.300.0100.08720.79
5.5.290.0200.07720.89
5.5.280.0170.06720.90
5.5.270.0170.07720.83
5.5.260.0130.07720.90
5.5.250.0170.07020.55
5.5.240.0100.07020.03
5.5.230.0030.07720.22
5.5.220.0230.06320.14
5.5.210.0100.07020.29
5.5.200.0070.07720.00
5.5.190.0130.07720.16
5.5.180.0070.08020.15
5.5.160.0070.07720.22
5.5.150.0130.07720.18
5.5.140.0070.07720.21
5.5.130.0030.08020.15
5.5.120.0130.07320.18
5.5.110.0170.05320.26
5.5.100.0100.07320.08
5.5.90.0170.07020.10
5.5.80.0030.08319.95
5.5.70.0070.08020.16
5.5.60.0100.07320.00
5.5.50.0130.08020.12
5.5.40.0100.07720.03
5.5.30.0070.07720.00
5.5.20.0100.07720.06
5.5.10.0030.04720.05
5.5.00.0100.07319.97
5.4.450.0070.07319.45
5.4.440.0030.05319.36
5.4.430.0100.06319.46
5.4.420.0130.07319.39
5.4.410.0130.04019.22
5.4.400.0170.06019.07
5.4.390.0070.07018.86
5.4.380.0100.07319.05
5.4.370.0070.08019.18
5.4.360.0170.06718.87
5.4.350.0030.07719.17
5.4.340.0100.07719.18
5.4.320.0030.05019.23
5.4.310.0170.06719.05
5.4.300.0100.07019.03
5.4.290.0070.05019.04
5.4.280.0100.06719.16
5.4.270.0100.07319.17
5.4.260.0100.05018.88
5.4.250.0100.07018.87
5.4.240.0100.06719.24
5.4.230.0030.08019.06
5.4.220.0100.07718.95
5.4.210.0030.07719.02
5.4.200.0170.03719.03
5.4.190.0070.03719.17
5.4.180.0100.05019.12
5.4.170.0070.04318.89
5.4.160.0030.07718.93
5.4.150.0270.03318.86
5.4.140.0030.07316.41
5.4.130.0100.07316.49
5.4.120.0070.07016.45
5.4.110.0100.06716.47
5.4.100.0030.08016.28
5.4.90.0030.07316.39
5.4.80.0100.05716.32
5.4.70.0000.07716.55
5.4.60.0000.07316.48
5.4.50.0070.07016.45
5.4.40.0070.05016.58
5.4.30.0100.06716.43
5.4.20.0070.07316.36
5.4.10.0070.07316.46
5.4.00.0100.06315.89
5.3.290.0030.07714.73
5.3.280.0200.06014.65
5.3.270.0070.07314.60
5.3.260.0130.07714.70
5.3.250.0200.05314.56
5.3.240.0070.07314.67
5.3.230.0100.07314.58
5.3.220.0070.07314.71
5.3.210.0070.07014.55
5.3.200.0070.06314.63
5.3.190.0030.08014.55
5.3.180.0130.07014.63
5.3.170.0100.07314.66
5.3.160.0170.06714.66
5.3.150.0030.05714.69
5.3.140.0130.04714.61
5.3.130.0000.07714.49
5.3.120.0100.04014.68
5.3.110.0000.06014.48
5.3.100.0100.07313.98
5.3.90.0100.07014.04
5.3.80.0100.07013.95
5.3.70.0130.06313.94
5.3.60.0130.07014.09
5.3.50.0100.06314.00
5.3.40.0100.07313.93
5.3.30.0100.04013.91
5.3.20.0070.04013.60
5.3.10.0100.06713.66
5.3.00.0030.05713.55
5.2.170.0070.06011.14
5.2.160.0030.05011.17
5.2.150.0100.04711.14
5.2.140.0030.06311.19
5.2.130.0000.06710.95
5.2.120.0030.06011.11
5.2.110.0000.06710.92
5.2.100.0070.05310.93
5.2.90.0000.03711.16
5.2.80.0070.06711.06
5.2.70.0100.05711.14
5.2.60.0030.06311.08
5.2.50.0030.04710.84
5.2.40.0070.06010.98
5.2.30.0100.05711.04
5.2.20.0100.05710.85
5.2.10.0000.06310.79
5.2.00.0000.06710.68
5.1.60.0070.05010.19
5.1.50.0000.05310.19
5.1.40.0100.04310.19
5.1.30.0070.05310.20
5.1.20.0030.05710.37
5.1.10.0070.05010.19
5.1.00.0070.04710.19
5.0.50.0000.04710.19
5.0.40.0030.04310.19
5.0.30.0000.06710.19
5.0.20.0030.04010.19
5.0.10.0030.04310.19
5.0.00.0030.06310.19
4.4.90.0030.03310.19
4.4.80.0030.03710.19
4.4.70.0000.03710.19
4.4.60.0000.03310.19
4.4.50.0030.03710.19
4.4.40.0030.05010.19
4.4.30.0130.02710.19
4.4.20.0030.03310.19
4.4.10.0000.03710.19
4.4.00.0030.05310.19
4.3.110.0030.03310.19
4.3.100.0000.02010.19
4.3.90.0030.02710.19
4.3.80.0030.05010.19
4.3.70.0000.03710.19
4.3.60.0000.03710.19
4.3.50.0030.03310.19
4.3.40.0030.05310.19
4.3.30.0000.03710.19
4.3.20.0000.03710.19
4.3.10.0070.03310.19
4.3.00.0000.02310.19

preferences:
54.67 ms | 401 KiB | 5 Q