3v4l.org

run code in 300+ PHP versions simultaneously
<?php if(!function_exists('is_assoc')){ function is_assoc($array) { return (bool)count(array_filter(array_keys($array), 'is_string')); } } /** * 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) { if(is_assoc($data)){ $d = $data; }else{ $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') ) ); $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.0110.00718.30
8.3.50.0040.01222.14
8.3.40.0070.00719.09
8.3.30.0120.00319.15
8.3.20.0040.00420.29
8.3.10.0000.00722.09
8.3.00.0080.00022.39
8.2.180.0080.00816.88
8.2.170.0080.00822.96
8.2.160.0060.01019.09
8.2.150.0050.00224.18
8.2.140.0040.00424.66
8.2.130.0080.00026.16
8.2.120.0040.00419.36
8.2.110.0060.00321.04
8.2.100.0040.00817.84
8.2.90.0050.00319.40
8.2.80.0050.00317.97
8.2.70.0050.00517.63
8.2.60.0050.00317.93
8.2.50.0040.00418.07
8.2.40.0030.00618.28
8.2.30.0040.00418.09
8.2.20.0000.00717.86
8.2.10.0060.00317.73
8.2.00.0070.00017.82
8.1.280.0090.00625.92
8.1.270.0080.00023.72
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0030.00621.06
8.1.230.0040.00720.81
8.1.220.0000.00817.77
8.1.210.0080.00018.77
8.1.200.0030.00617.61
8.1.190.0000.00817.42
8.1.180.0040.00418.10
8.1.170.0050.00318.77
8.1.160.0080.00021.95
8.1.150.0000.00818.71
8.1.140.0040.00417.53
8.1.130.0030.00317.88
8.1.120.0000.00717.51
8.1.110.0050.00317.56
8.1.100.0040.00417.64
8.1.90.0000.00717.62
8.1.80.0050.00317.47
8.1.70.0040.00417.50
8.1.60.0000.00817.59
8.1.50.0030.00617.62
8.1.40.0040.00417.50
8.1.30.0040.00417.70
8.1.20.0050.00317.66
8.1.10.0040.00417.64
8.1.00.0070.00017.62
8.0.300.0080.00018.77
8.0.290.0000.00717.28
8.0.280.0070.00018.49
8.0.270.0040.00417.35
8.0.260.0000.00716.90
8.0.250.0070.00017.00
8.0.240.0050.00217.09
8.0.230.0000.00717.08
8.0.220.0070.00017.05
8.0.210.0000.00816.91
8.0.200.0000.00617.04
8.0.190.0000.00716.93
8.0.180.0020.00516.99
8.0.170.0060.00317.05
8.0.160.0040.00416.88
8.0.150.0000.00716.82
8.0.140.0000.00817.00
8.0.130.0060.00013.26
8.0.120.0000.00816.92
8.0.110.0020.00516.91
8.0.100.0000.00816.85
8.0.90.0000.00716.99
8.0.80.0060.01216.97
8.0.70.0040.00416.79
8.0.60.0040.00416.92
8.0.50.0040.00417.04
8.0.30.0140.00517.20
8.0.20.0100.00917.43
8.0.10.0080.00017.16
8.0.00.0080.01117.05
7.4.330.0000.00515.15
7.4.320.0030.00316.51
7.4.300.0000.00616.59
7.4.290.0040.00416.71
7.4.280.0070.00016.53
7.4.270.0080.00316.48
7.4.260.0070.00316.54
7.4.250.0060.00316.60
7.4.240.0060.00116.61
7.4.230.0070.00016.43
7.4.220.0100.01016.59
7.4.210.0070.01016.67
7.4.200.0000.00716.79
7.4.190.0070.00016.48
7.4.160.0030.01316.53
7.4.150.0090.00917.40
7.4.140.0130.00817.86
7.4.130.0110.01016.68
7.4.120.0160.00316.51
7.4.110.0120.00616.83
7.4.100.0140.01116.75
7.4.90.0110.00716.57
7.4.80.0070.01319.39
7.4.70.0110.01416.54
7.4.60.0120.00916.59
7.4.50.0080.00016.18
7.4.40.0070.01022.77
7.4.30.0080.00816.62
7.4.00.0090.00915.09
7.3.330.0000.00613.30
7.3.320.0030.00313.18
7.3.310.0050.00216.35
7.3.300.0030.00316.32
7.3.290.0040.01116.34
7.3.280.0090.00716.40
7.3.270.0070.01017.40
7.3.260.0160.00316.41
7.3.250.0130.00716.62
7.3.240.0060.01016.61
7.3.230.0060.01216.54
7.3.210.0130.01116.52
7.3.200.0170.00019.39
7.3.190.0130.01016.58
7.3.180.0130.01016.41
7.3.170.0140.00716.36
7.3.160.0130.00416.52
7.3.120.0070.00714.91
7.2.330.0060.01716.74
7.2.320.0060.01816.60
7.2.310.0140.00316.85
7.2.300.0060.01016.95
7.2.290.0160.00016.63
7.2.110.0230.01016.68
7.2.00.0080.00519.58
7.1.200.0000.01415.96
7.1.100.0040.00718.53
7.1.70.0000.00917.35
7.1.60.0060.01919.82
7.1.50.0040.01817.16
7.1.00.0130.06722.45
7.0.200.0040.00816.88
7.0.140.0030.07322.08
7.0.80.0470.06019.89
7.0.70.0300.08720.16
7.0.60.0470.06720.00
7.0.50.0300.07720.39
7.0.40.0030.08720.11
7.0.30.0170.07720.18
7.0.20.0030.04319.92
7.0.10.0130.07320.02
7.0.00.0100.07720.04
5.6.280.0100.06721.12
5.6.230.0070.07320.49
5.6.220.0130.07320.51
5.6.210.0100.08320.49
5.6.200.0030.08721.01
5.6.190.0030.05321.05
5.6.180.0030.08021.12
5.6.170.0100.05321.01
5.6.160.0100.08020.96
5.6.150.0070.08021.01
5.6.140.0030.08321.05
5.6.130.0100.09021.17
5.6.120.0130.06021.01
5.6.110.0170.07720.95
5.6.100.0100.08320.94
5.6.90.0170.08021.04
5.6.80.0000.09020.53
5.6.70.0130.06020.39
5.6.60.0030.08320.33
5.6.50.0170.07020.45
5.6.40.0070.04020.43
5.6.30.0100.04720.37
5.6.20.0030.09020.39
5.6.10.0130.07320.38
5.6.00.0070.05720.41
5.5.370.0100.08020.40
5.5.360.0130.07720.41
5.5.350.0100.07320.45
5.5.340.0100.04720.89
5.5.330.0070.05020.94
5.5.320.0070.08320.74
5.5.310.0130.04720.80
5.5.300.0130.06020.91
5.5.290.0070.05320.84
5.5.280.0030.05020.72
5.5.270.0070.08720.87
5.5.260.0030.07020.79
5.5.250.0100.05720.55
5.5.240.0170.07320.18
5.5.230.0030.08720.30
5.5.220.0030.08320.21
5.5.210.0130.07720.27
5.5.200.0070.03720.26
5.5.190.0030.08019.98
5.5.180.0070.08320.28
5.5.160.0030.07020.27
5.5.150.0070.09720.18
5.5.140.0030.08320.08
5.5.130.0030.08320.18
5.5.120.0100.06720.13
5.5.110.0130.07720.27
5.5.100.0170.07020.11
5.5.90.0100.05320.11
5.5.80.0100.06020.07
5.5.70.0070.03720.09
5.5.60.0030.03720.16
5.5.50.0000.04320.20
5.5.40.0100.03719.94
5.5.30.0030.03720.03
5.5.20.0000.04020.08
5.5.10.0000.04320.03
5.5.00.0070.07020.10
5.4.450.0130.07319.50
5.4.440.0070.04319.17
5.4.430.0100.07719.50
5.4.420.0070.08019.37
5.4.410.0100.07719.36
5.4.400.0100.07319.04
5.4.390.0100.07019.13
5.4.380.0030.07719.12
5.4.370.0070.07718.90
5.4.360.0130.04318.88
5.4.350.0070.07718.90
5.4.340.0070.05018.91
5.4.320.0070.08019.21
5.4.310.0030.07718.95
5.4.300.0170.06718.94
5.4.290.0100.08019.03
5.4.280.0030.06319.20
5.4.270.0100.04719.04
5.4.260.0130.07318.82
5.4.250.0100.07019.08
5.4.240.0130.05319.15
5.4.230.0100.03719.10
5.4.220.0100.03318.94
5.4.210.0000.04018.94
5.4.200.0170.06319.08
5.4.190.0030.04719.04
5.4.180.0000.04719.03
5.4.170.0100.03319.15
5.4.160.0000.04019.14
5.4.150.0070.03319.02
5.4.140.0030.03716.41
5.4.130.0100.06316.38
5.4.120.0130.02716.56
5.4.110.0070.06016.32
5.4.100.0000.04716.48
5.4.90.0070.03316.55
5.4.80.0000.03716.38
5.4.70.0030.03316.54
5.4.60.0070.03016.46
5.4.50.0030.03716.34
5.4.40.0000.04016.54
5.4.30.0070.03316.51
5.4.20.0030.03716.40
5.4.10.0030.03716.46
5.4.00.0000.03715.79
5.3.290.0000.05014.60
5.3.280.0030.03714.69
5.3.270.0070.03014.66
5.3.260.0030.04314.56
5.3.250.0130.03014.68
5.3.240.0100.02714.62
5.3.230.0030.04014.63
5.3.220.0070.03314.60
5.3.210.0070.03714.50
5.3.200.0070.04714.54
5.3.190.0000.03714.66
5.3.180.0070.03314.63
5.3.170.0000.04014.70
5.3.160.0130.03314.50
5.3.150.0000.04014.68
5.3.140.0030.05314.54
5.3.130.0000.04014.51
5.3.120.0000.04014.51
5.3.110.0070.04014.54
5.3.100.0070.03713.98
5.3.90.0070.03314.16
5.3.80.0000.04714.03
5.3.70.0030.03714.13
5.3.60.0070.03714.10
5.3.50.0070.05014.11
5.3.40.0000.04013.93
5.3.30.0000.04013.93
5.3.20.0070.03013.75
5.3.10.0030.03313.59
5.3.00.0000.04313.62
5.2.170.0030.03711.18
5.2.160.0000.03011.24
5.2.150.0100.02011.01
5.2.140.0070.03011.25
5.2.130.0000.03011.24
5.2.120.0000.03011.02
5.2.110.0030.02311.00
5.2.100.0000.03011.17
5.2.90.0070.02311.16
5.2.80.0030.03711.24
5.2.70.0100.02311.16
5.2.60.0100.01710.94
5.2.50.0100.01711.06
5.2.40.0000.03011.12
5.2.30.0000.02710.98
5.2.20.0000.03011.00
5.2.10.0000.03010.93
5.2.00.0070.03010.77
5.1.60.0000.03710.12
5.1.50.0030.02310.10
5.1.40.0030.05010.07
5.1.30.0100.04710.28
5.1.20.0030.03710.30
5.1.10.0030.04310.16
5.1.00.0070.05010.16
5.0.50.0000.0408.54
5.0.40.0030.0438.51
5.0.30.0000.0378.07
5.0.20.0030.0438.29
5.0.10.0000.0408.28
5.0.00.0070.0608.21
4.4.90.0000.0177.08
4.4.80.0000.0177.08
4.4.70.0070.0107.08
4.4.60.0000.0137.08
4.4.50.0030.0137.08
4.4.40.0000.0337.08
4.4.30.0000.0207.08
4.4.20.0000.0377.08
4.4.10.0000.0377.08
4.4.00.0000.0507.08
4.3.110.0070.0277.08
4.3.100.0000.0337.08
4.3.90.0070.0307.08
4.3.80.0000.0277.08
4.3.70.0000.0337.08
4.3.60.0000.0237.08
4.3.50.0070.0307.08
4.3.40.0070.0537.08
4.3.30.0030.0307.08
4.3.20.0000.0307.08
4.3.10.0000.0177.08
4.3.00.0070.0307.08

preferences:
39.63 ms | 401 KiB | 5 Q