3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * getCols * * Takes an array of associative arrays and combines them to get * the columns * * @author Joe Richardson * @access public * @return object Instance of DB or Null */ function getCols(array $data, $col = NULL) { $d = (array)call_user_func_array('array_merge_recursive',$data); return ($col === NULL)?$d:$d[$col]; } $a = array( array( 'id' => 1 , 'name' => 'foo' , 'date' => date('m-d-Y') ) , array( 'id' => 2 , 'name' => 'bar' , 'date' => date('m-d-Y') ) , array( 'id' => 3 , 'name' => 'george' , 'date' => date('m-d-Y') ) , array( 'id' => 4 , 'name' => 'burdell' , 'date' => date('m-d-Y') ) ); if(function_exists('array_column')) { echo('array_column '); $b = array_columns($a, 'name'); }else { echo('getCols '); $b = getCols($a, 'name'); } var_dump($b);

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.0130.00718.55
8.3.50.0060.01322.06
8.3.40.0120.00919.13
8.3.30.0070.00719.21
8.3.20.0040.00420.29
8.3.10.0040.00423.68
8.3.00.0000.00822.43
8.2.180.0190.00016.61
8.2.170.0070.00722.96
8.2.160.0100.00322.06
8.2.150.0000.00924.18
8.2.140.0030.00624.66
8.2.130.0080.00026.16
8.2.120.0050.00319.48
8.2.110.0060.00319.27
8.2.100.0040.00817.97
8.2.90.0040.00419.36
8.2.80.0040.00417.97
8.2.70.0060.00317.63
8.2.60.0000.00818.05
8.2.50.0060.00318.07
8.2.40.0000.00818.28
8.2.30.0050.00218.19
8.2.20.0060.00317.85
8.2.10.0040.00417.88
8.2.00.0070.00017.76
8.1.280.0090.00925.92
8.1.270.0070.00023.87
8.1.260.0080.00026.35
8.1.250.0000.00728.09
8.1.240.0050.00521.14
8.1.230.0060.00617.58
8.1.220.0000.00817.78
8.1.210.0000.00818.77
8.1.200.0070.00317.47
8.1.190.0040.00417.47
8.1.180.0040.00418.10
8.1.170.0000.00818.77
8.1.160.0000.00721.90
8.1.150.0040.00418.81
8.1.140.0040.00417.54
8.1.130.0000.00717.82
8.1.120.0040.00417.59
8.1.110.0040.00417.59
8.1.100.0050.00217.59
8.1.90.0000.00717.52
8.1.80.0030.00417.61
8.1.70.0000.00717.59
8.1.60.0060.00317.53
8.1.50.0000.00817.49
8.1.40.0000.00717.61
8.1.30.0030.00617.67
8.1.20.0050.00317.55
8.1.10.0040.00417.58
8.1.00.0030.00517.56
8.0.300.0000.00818.77
8.0.290.0000.00816.88
8.0.280.0030.00318.52
8.0.270.0040.00417.25
8.0.260.0060.00316.99
8.0.250.0050.00317.03
8.0.240.0060.00317.05
8.0.230.0030.00317.18
8.0.220.0000.00717.11
8.0.210.0000.00717.11
8.0.200.0000.00717.08
8.0.190.0070.00517.04
8.0.180.0080.00417.06
8.0.170.0000.01016.95
8.0.160.0070.00017.08
8.0.150.0040.00416.93
8.0.140.0040.00417.00
8.0.130.0060.00013.39
8.0.120.0080.00017.05
8.0.110.0000.00816.86
8.0.100.0000.00716.86
8.0.90.0030.00517.05
8.0.80.0060.00917.02
8.0.70.0050.00316.90
8.0.60.0000.00716.85
8.0.50.0040.00417.02
8.0.30.0100.01017.21
8.0.20.0090.00917.40
8.0.10.0000.00717.23
8.0.00.0090.01116.90
7.4.330.0030.00315.03
7.4.320.0000.00716.60
7.4.300.0000.00616.65
7.4.290.0070.00016.56
7.4.280.0050.00316.59
7.4.270.0070.00016.64
7.4.260.0000.00716.58
7.4.250.0030.00516.56
7.4.240.0020.00516.60
7.4.230.0030.00316.47
7.4.220.0090.01216.74
7.4.210.0080.00816.62
7.4.200.0030.00316.61
7.4.190.0030.00316.85
7.4.160.0240.00016.63
7.4.150.0060.01217.40
7.4.140.0120.00517.86
7.4.130.0040.01316.65
7.4.120.0060.01016.72
7.4.110.0070.01116.65
7.4.100.0200.00016.73
7.4.90.0070.01116.56
7.4.80.0030.01716.81
7.4.70.0060.00916.86
7.4.60.0120.00616.61
7.4.50.0030.00616.18
7.4.40.0090.00622.77
7.4.30.0060.00916.81
7.4.10.0000.01915.04
7.4.00.0000.01515.15
7.3.330.0000.00613.29
7.3.320.0030.00313.36
7.3.310.0070.00016.40
7.3.300.0000.00716.23
7.3.290.0000.01416.40
7.3.280.0100.00816.38
7.3.270.0120.00617.40
7.3.260.0130.01116.37
7.3.250.0120.00516.43
7.3.240.0100.01016.63
7.3.230.0160.00016.51
7.3.210.0110.00616.56
7.3.200.0090.00919.39
7.3.190.0100.00716.57
7.3.180.0070.01016.57
7.3.170.0130.00316.59
7.3.160.0090.00616.50
7.3.130.0060.01314.86
7.3.120.0120.00414.82
7.3.110.0080.01115.15
7.3.100.0110.00715.16
7.3.90.0030.01315.03
7.3.80.0030.01015.12
7.3.70.0060.00314.73
7.3.60.0040.01214.86
7.3.50.0030.00714.76
7.3.40.0040.00415.04
7.3.30.0040.00814.96
7.3.20.0030.01016.76
7.3.10.0070.00716.66
7.3.00.0070.01016.54
7.2.330.0030.01416.86
7.2.320.0030.01316.83
7.2.310.0120.00816.60
7.2.300.0060.01116.54
7.2.290.0100.00616.66
7.2.260.0070.01015.00
7.2.250.0060.01214.87
7.2.240.0040.01115.33
7.2.230.0000.01915.43
7.2.220.0070.01015.17
7.2.210.0040.01415.41
7.2.200.0060.00915.20
7.2.190.0080.00315.24
7.2.180.0030.01215.30
7.2.170.0060.00615.20
7.2.160.0060.00914.97
7.2.150.0040.01117.06
7.2.140.0040.01416.94
7.2.130.0070.00717.02
7.2.120.0100.00316.91
7.2.110.0060.00616.83
7.2.100.0120.00317.12
7.2.90.0070.01017.14
7.2.80.0070.01317.12
7.2.70.0120.00316.85
7.2.60.0060.01116.87
7.2.50.0070.00416.91
7.2.40.0040.00717.05
7.2.30.0130.00317.15
7.2.20.0000.01616.77
7.2.10.0000.01017.08
7.2.00.0040.01117.12
7.1.330.0060.01015.74
7.1.320.0100.00015.68
7.1.310.0100.00315.98
7.1.300.0040.00815.64
7.1.290.0030.00715.81
7.1.280.0070.00715.43
7.1.270.0060.01015.80
7.1.260.0060.00615.80
7.1.250.0040.00715.66
7.1.240.0000.00915.64
7.1.230.0040.00815.94
7.1.220.0040.00415.86
7.1.210.0060.01315.91
7.1.200.0080.00315.80
7.1.190.0120.00015.82
7.1.180.0090.00615.84
7.1.170.0000.01415.75
7.1.160.0040.00815.73
7.1.150.0000.01616.02
7.1.140.0040.00815.74
7.1.130.0030.01015.48
7.1.120.0000.00915.52
7.1.110.0070.00415.66
7.1.100.0070.00716.97
7.1.90.0030.00615.73
7.1.80.0080.00415.76
7.1.70.0010.00816.53
7.1.60.0030.01817.43
7.1.50.0070.00916.26
7.1.40.0040.00715.55
7.1.30.0040.00715.85
7.1.20.0040.00815.91
7.1.10.0090.00015.93
7.1.00.0100.04519.19
7.0.330.0030.01315.43
7.0.320.0160.00015.29
7.0.310.0030.00615.36
7.0.300.0070.00715.59
7.0.290.0000.01315.25
7.0.280.0060.00615.64
7.0.270.0030.01015.39
7.0.260.0000.00915.44
7.0.250.0060.00615.35
7.0.240.0000.00915.36
7.0.230.0070.00715.38
7.0.220.0000.00815.12
7.0.210.0000.00815.29
7.0.200.0100.00516.22
7.0.190.0040.01115.54
7.0.180.0030.00915.20
7.0.170.0040.00815.33
7.0.160.0100.00315.59
7.0.150.0060.00315.62
7.0.140.0060.04018.71
7.0.130.0000.01315.38
7.0.120.0000.01215.47
7.0.110.0060.00615.56
7.0.100.0090.00315.42
7.0.90.0060.00915.25
7.0.80.0160.04117.71
7.0.70.0170.03317.71
7.0.60.0080.04517.65
7.0.50.0070.04718.01
7.0.40.0030.03216.81
7.0.30.0120.02016.76
7.0.20.0030.02716.86
7.0.10.0050.02416.83
7.0.00.0030.02516.79
5.6.400.0070.01014.41
5.6.390.0070.00714.51
5.6.380.0040.01114.57
5.6.370.0040.00714.18
5.6.360.0080.00314.56
5.6.350.0090.00614.26
5.6.340.0070.00714.53
5.6.330.0080.00314.17
5.6.320.0030.00714.65
5.6.310.0090.00614.41
5.6.300.0030.01014.21
5.6.290.0080.00814.39
5.6.280.0010.04017.71
5.6.270.0000.00814.71
5.6.260.0030.01014.32
5.6.250.0070.00714.32
5.6.240.0040.00814.45
5.6.230.0070.02717.47
5.6.220.0090.04317.45
5.6.210.0030.04217.40
5.6.200.0070.02817.68
5.6.190.0150.03617.82
5.6.180.0000.03217.69
5.6.170.0030.02817.82
5.6.160.0030.02617.63
5.6.150.0070.02217.80
5.6.140.0070.02017.76
5.6.130.0050.04317.79
5.6.120.0020.03317.65
5.6.110.0090.02217.69
5.6.100.0050.02317.70
5.6.90.0090.02417.58
5.6.80.0070.02017.24
5.6.70.0050.02717.37
5.6.60.0080.02117.21
5.6.50.0040.02917.35
5.6.40.0030.02317.36
5.6.30.0030.02117.23
5.6.20.0080.02017.33
5.6.10.0070.02017.28
5.6.00.0050.02017.27
5.5.380.0100.01014.30
5.5.370.0120.03817.21
5.5.360.0110.04317.22
5.5.350.0020.05217.37
5.5.340.0150.03817.63
5.5.330.0030.03017.53
5.5.320.0120.01917.57
5.5.310.0090.02417.52
5.5.300.0070.02317.59
5.5.290.0040.04517.60
5.5.280.0100.01817.56
5.5.270.0020.02517.46
5.5.260.0070.02217.67
5.5.250.0020.02617.38
5.5.240.0090.04117.37
5.5.230.0050.02017.14
5.5.220.0030.02217.10
5.5.210.0030.03617.05
5.5.200.0050.02317.36
5.5.190.0050.02317.09
5.5.180.0080.03217.22
5.5.170.0040.00414.30
5.5.160.0070.02217.27
5.5.150.0050.02217.24
5.5.140.0000.02717.15
5.5.130.0050.02217.22
5.5.120.0020.02617.17
5.5.110.0020.02617.36
5.5.100.0030.02517.17
5.5.90.0100.02217.14
5.5.80.0030.02517.26
5.5.70.0050.02517.12
5.5.60.0050.03117.04
5.5.50.0070.01917.12
5.5.40.0100.03517.13
5.5.30.0070.04317.03
5.5.20.0050.04317.21
5.5.10.0130.03717.15
5.5.00.0080.04017.00
5.4.450.0030.02316.27
5.4.440.0050.02316.29
5.4.430.0030.02516.16
5.4.420.0030.02516.29
5.4.410.0050.03116.18
5.4.400.0020.02516.02
5.4.390.0070.01815.99
5.4.380.0030.02516.13
5.4.370.0040.02316.13
5.4.360.0050.02016.13
5.4.350.0060.02216.06
5.4.340.0030.02316.14
5.4.330.0080.00013.13
5.4.320.0020.03016.00
5.4.310.0070.01816.13
5.4.300.0030.02816.00
5.4.290.0030.03616.13
5.4.280.0060.02016.17
5.4.270.0060.01716.15
5.4.260.0040.01916.01
5.4.250.0000.02316.14
5.4.240.0070.01916.11
5.4.230.0080.02816.01
5.4.220.0100.03416.15
5.4.210.0080.03516.02
5.4.200.0030.02516.12
5.4.190.0060.02116.16
5.4.180.0050.02416.12
5.4.170.0080.04216.01
5.4.160.0030.03716.07
5.4.150.0050.02516.08
5.4.140.0030.04114.69
5.4.130.0050.03414.79
5.4.120.0000.02614.80
5.4.110.0030.03514.81
5.4.100.0070.01714.70
5.4.90.0040.04214.79
5.4.80.0080.03414.80
5.4.70.0010.04614.74
5.4.60.0050.04014.69
5.4.50.0040.04114.80
5.4.40.0080.03714.82
5.4.30.0050.03914.76
5.4.20.0050.03714.76
5.4.10.0070.04014.74
5.4.00.0030.04114.46
5.3.290.0070.02713.87
5.3.280.0030.02613.87
5.3.270.0050.04213.90
5.3.260.0050.04013.87
5.3.250.0050.03213.90
5.3.240.0030.02713.84
5.3.230.0030.03413.88
5.3.220.0040.04113.88
5.3.210.0060.03613.88
5.3.200.0060.03113.84
5.3.190.0020.04813.81
5.3.180.0080.03813.86
5.3.170.0000.03513.89
5.3.160.0030.04113.83
5.3.150.0100.02013.88
5.3.140.0080.03513.85
5.3.130.0020.03813.91
5.3.120.0080.03913.90
5.3.110.0070.03613.91
5.3.100.0050.03513.63
5.3.90.0030.02513.56
5.3.80.0070.03813.61
5.3.70.0020.03213.61
5.3.60.0050.02213.53
5.3.50.0020.04213.50
5.3.40.0080.03813.60
5.3.30.0040.04113.55
5.3.20.0030.02813.42
5.3.10.0080.03713.46
5.3.00.0030.04213.39
5.2.170.0000.04311.18
5.2.160.0130.02311.07
5.2.150.0030.03311.05
5.2.140.0070.05011.14
5.2.130.0170.05011.17
5.2.120.0030.04011.01
5.2.110.0070.05311.20
5.2.100.0070.05711.11
5.2.90.0030.06711.00
5.2.80.0030.05011.23
5.2.70.0130.06011.11
5.2.60.0100.04711.13
5.2.50.0070.05710.93
5.2.40.0030.07011.06
5.2.30.0000.06710.97
5.2.20.0030.05311.02
5.2.10.0000.05710.72
5.2.00.0130.04010.83
5.1.60.0070.04310.69
5.1.50.0000.05710.69
5.1.40.0030.05010.69
5.1.30.0070.04010.69
5.1.20.0070.05010.69
5.1.10.0030.04310.69
5.1.00.0100.03010.69
5.0.50.0000.02710.69
5.0.40.0070.03310.69
5.0.30.0070.05010.69
5.0.20.0030.04010.69
5.0.10.0070.03310.69
5.0.00.0070.06010.69
4.4.90.0000.03310.69
4.4.80.0000.03010.69
4.4.70.0030.03710.69
4.4.60.0030.03710.69
4.4.50.0030.03710.69
4.4.40.0030.05310.69
4.4.30.0000.03710.69
4.4.20.0000.04010.69
4.4.10.0070.02710.69
4.4.00.0000.05310.69
4.3.110.0000.03710.69
4.3.100.0030.03310.69
4.3.90.0070.03010.69
4.3.80.0000.05710.69
4.3.70.0070.01310.69
4.3.60.0000.02310.69
4.3.50.0030.02010.69
4.3.40.0000.05710.69
4.3.30.0070.03010.69
4.3.20.0030.03010.69
4.3.10.0000.03010.69
4.3.00.0000.03710.69

preferences:
37.81 ms | 401 KiB | 5 Q