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) { if(is_assoc($data)){ return $data; }else{ return (array)call_user_func_array('array_merge_recursive',$data); } } $a = array( array( 'id' => 1 , 'name' => 'foo' , 'date' => date() ) , array( 'id' => 2 , 'name' => 'bar' , 'date' => date() ) , array( 'id' => 3 , 'name' => 'george' , 'date' => date() ) , array( 'id' => 4 , 'name' => 'burdell' , 'date' => date() ) ); $b = getCols($a); 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.0140.00718.52
8.3.50.0100.00822.06
8.3.40.0090.00919.02
8.3.30.0130.00318.84
8.3.20.0040.00418.73
8.3.10.0040.00421.14
8.3.00.0040.00423.61
8.2.180.0120.00916.88
8.2.170.0170.00022.96
8.2.160.0100.01020.57
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0000.00819.48
8.2.110.0060.00320.38
8.2.100.0060.00617.84
8.2.90.0040.00419.30
8.2.80.0040.00717.97
8.2.70.0000.00817.63
8.2.60.0060.00318.04
8.2.50.0000.01118.07
8.2.40.0100.00018.14
8.2.30.0000.00819.90
8.2.20.0040.00417.71
8.2.10.0040.00417.71
8.2.00.0000.00817.86
8.1.280.0070.01425.92
8.1.270.0000.00823.99
8.1.260.0080.00026.35
8.1.250.0050.00328.09
8.1.240.0060.00322.62
8.1.230.0060.00620.95
8.1.220.0040.00418.77
8.1.210.0040.00418.93
8.1.200.0030.00617.25
8.1.190.0040.00417.53
8.1.180.0000.00818.10
8.1.170.0040.00418.64
8.1.160.0040.00418.85
8.1.150.0080.00318.51
8.1.140.0040.00417.41
8.1.130.0030.00317.79
8.1.120.0080.00017.44
8.1.110.0000.00817.27
8.1.100.0040.00417.42
8.1.90.0040.00417.49
8.1.80.0020.00517.39
8.1.70.0000.00717.29
8.1.60.0050.00217.51
8.1.50.0000.00917.49
8.1.40.0000.00817.50
8.1.30.0070.00017.45
8.1.20.0000.00817.64
8.1.10.0040.00417.55
8.1.00.0060.00317.42
8.0.300.0040.00420.02
8.0.290.0040.00417.18
8.0.280.0000.00718.54
8.0.270.0030.00317.20
8.0.260.0040.00417.01
8.0.250.0000.00817.13
8.0.240.0050.00317.11
8.0.230.0030.00317.14
8.0.220.0070.00017.04
8.0.210.0000.00717.10
8.0.200.0000.00616.96
8.0.190.0040.00417.05
8.0.180.0070.00016.90
8.0.170.0030.00616.91
8.0.160.0070.00017.00
8.0.150.0060.00317.05
8.0.140.0060.00316.83
8.0.130.0000.00613.45
8.0.120.0040.00416.98
8.0.110.0040.00416.86
8.0.100.0070.00016.87
8.0.90.0040.00416.98
8.0.80.0060.00916.98
8.0.70.0040.00416.80
8.0.60.0060.00316.97
8.0.50.0050.00316.99
8.0.30.0110.00716.99
8.0.20.0100.01017.40
8.0.10.0000.00716.84
8.0.00.0140.01016.68
7.4.330.0060.00013.43
7.4.320.0070.00016.42
7.4.300.0050.00316.48
7.4.290.0070.00016.66
7.4.280.0050.00216.60
7.4.270.0000.00716.46
7.4.260.0000.00613.25
7.4.250.0050.00216.39
7.4.240.0000.00716.62
7.4.230.0000.00716.52
7.4.220.0130.00316.65
7.4.210.0080.00816.58
7.4.200.0000.00716.52
7.4.190.0070.00016.70
7.4.160.0060.01016.34
7.4.150.0130.00617.40
7.4.140.0080.01017.86
7.4.130.0090.00816.58
7.4.120.0080.00916.55
7.4.110.0110.00616.64
7.4.100.0140.00716.59
7.4.90.0060.01216.59
7.4.80.0040.01519.37
7.4.70.0130.00316.58
7.4.60.0150.00316.37
7.4.50.0040.00416.57
7.4.40.0100.00722.27
7.4.30.0070.01116.57
7.4.00.0070.01015.22
7.3.330.0000.00613.35
7.3.320.0000.00713.18
7.3.310.0030.00316.20
7.3.300.0000.00716.30
7.3.290.0080.00816.24
7.3.280.0110.00516.32
7.3.270.0090.00917.40
7.3.260.0070.01118.24
7.3.250.0130.00616.46
7.3.240.0080.00816.54
7.3.230.0100.00716.39
7.3.210.0130.00716.46
7.3.200.0060.01119.39
7.3.190.0060.01016.44
7.3.180.0030.01316.38
7.3.170.0110.01016.54
7.3.160.0040.01216.51
7.3.120.0030.01214.92
7.3.10.0090.00316.62
7.3.00.0120.00316.73
7.2.330.0180.00016.84
7.2.320.0070.01016.78
7.2.310.0110.00716.61
7.2.300.0100.01416.88
7.2.290.0090.00616.81
7.2.130.0040.01017.06
7.2.120.0020.01417.05
7.2.110.0080.00816.90
7.2.100.0090.00917.04
7.2.90.0050.00616.84
7.2.80.0030.01117.04
7.2.70.0040.00917.12
7.2.60.0030.01016.97
7.2.50.0030.01216.89
7.2.40.0070.00717.01
7.2.30.0030.00816.95
7.2.20.0050.00917.05
7.2.10.0070.00716.85
7.2.00.0050.00617.74
7.1.250.0050.00815.81
7.1.240.0040.00715.80
7.1.230.0000.01415.63
7.1.220.0030.00815.47
7.1.210.0070.00715.66
7.1.200.0030.00915.82
7.1.190.0060.00815.91
7.1.180.0100.00315.76
7.1.170.0000.01715.67
7.1.160.0070.00315.88
7.1.150.0110.00315.80
7.1.140.0100.00315.75
7.1.130.0070.00715.76
7.1.120.0100.00615.40
7.1.110.0040.00715.85
7.1.100.0020.00916.82
7.1.90.0000.01315.72
7.1.80.0040.00715.59
7.1.70.0070.00816.25
7.1.60.0080.01117.58
7.1.50.0060.01116.32
7.1.40.0110.00615.38
7.1.30.0000.01415.48
7.1.20.0110.00415.85
7.1.10.0060.00915.56
7.1.00.0050.03318.91
7.0.330.0120.00315.29
7.0.320.0060.00615.18
7.0.310.0060.00615.06
7.0.300.0030.00715.33
7.0.290.0070.00615.23
7.0.280.0060.00615.41
7.0.270.0060.00615.33
7.0.260.0070.00715.37
7.0.250.0080.00415.41
7.0.240.0060.00615.37
7.0.230.0040.00715.52
7.0.220.0000.01115.30
7.0.210.0080.00015.32
7.0.200.0070.00516.12
7.0.190.0040.01115.21
7.0.180.0120.00315.34
7.0.170.0090.00615.26
7.0.160.0030.01015.47
7.0.150.0090.00315.38
7.0.140.0090.03718.57
7.0.130.0000.01715.56
7.0.120.0060.00915.30
7.0.110.0000.01515.51
7.0.100.0070.03117.73
7.0.90.0050.04617.69
7.0.80.0050.04717.44
7.0.70.0070.02717.52
7.0.60.0100.03817.68
7.0.50.0050.04617.83
7.0.40.0120.03316.70
7.0.30.0070.04416.59
7.0.20.0030.05016.82
7.0.10.0050.04716.78
7.0.00.0050.04916.69
5.6.380.0100.00714.04
5.6.370.0040.00814.23
5.6.360.0040.01114.41
5.6.350.0070.00714.56
5.6.340.0000.01114.14
5.6.330.0030.00614.03
5.6.320.0000.01314.30
5.6.310.0060.00314.46
5.6.300.0000.00914.32
5.6.290.0040.01114.23
5.6.280.0030.04217.46
5.6.270.0090.00613.86
5.6.260.0000.01214.42
5.6.250.0030.04617.44
5.6.240.0070.02717.55
5.6.230.0110.04017.46
5.6.220.0100.04317.32
5.6.210.0100.04217.42
5.6.200.0090.04517.65
5.6.190.0050.03417.77
5.6.180.0060.04517.79
5.6.170.0070.04617.62
5.6.160.0080.04217.48
5.6.150.0050.04817.73
5.6.140.0120.04217.84
5.6.130.0080.03217.75
5.6.120.0070.04017.61
5.6.110.0070.04817.64
5.6.100.0100.03917.68
5.6.90.0140.03517.65
5.6.80.0060.02717.21
5.6.70.0070.04217.43
5.6.60.0070.04117.22
5.6.50.0000.04617.42
5.6.40.0120.03517.23
5.6.30.0090.03817.39
5.6.20.0080.04317.29
5.6.10.0090.03617.36
5.6.00.0100.03117.31
5.5.380.0100.02515.79
5.5.370.0050.04515.84
5.5.360.0050.04015.95
5.5.350.0080.04015.85
5.5.340.0080.04016.10
5.5.330.0030.04516.04
5.5.320.0110.04015.91
5.5.310.0020.04716.05
5.5.300.0020.03516.00
5.5.290.0080.02516.00
5.5.280.0100.02016.03
5.5.270.0080.03016.08
5.5.260.0070.04416.00
5.5.250.0100.02815.92
5.5.240.0070.04315.68
5.5.230.0080.04115.67
5.5.220.0060.04015.65
5.5.210.0100.03715.70
5.5.200.0070.02315.66
5.5.190.0050.03715.78
5.5.180.0080.04315.66
5.5.170.0030.00911.20
5.5.160.0080.04215.66
5.5.150.0120.02715.80
5.5.140.0100.03215.66
5.5.130.0100.04015.75
5.5.120.0120.03715.66
5.5.110.0100.02015.72
5.5.100.0050.04515.62
5.5.90.0070.03015.56
5.5.80.0100.02815.61
5.5.70.0050.04215.64
5.5.60.0070.04115.66
5.5.50.0060.02115.62
5.5.40.0080.04115.66
5.5.30.0080.03515.61
5.5.20.0030.02415.60
5.5.10.0020.02315.60
5.5.00.0070.02515.61
5.4.450.0060.04115.27
5.4.440.0050.02615.27
5.4.430.0050.04315.26
5.4.420.0070.04115.39
5.4.410.0030.04515.23
5.4.400.0050.03515.03
5.4.390.0140.03315.11
5.4.380.0050.02315.01
5.4.370.0100.04015.11
5.4.360.0060.03715.16
5.4.350.0100.04015.14
5.4.340.0150.03115.10
5.4.330.0030.00711.19
5.4.320.0050.04415.17
5.4.310.0050.02515.11
5.4.300.0030.03815.13
5.4.290.0100.03515.21
5.4.280.0050.03115.04
5.4.270.0080.03715.20
5.4.260.0110.02915.18
5.4.250.0060.03815.13
5.4.240.0070.03215.13
5.4.230.0050.04115.20
5.4.220.0050.03515.14
5.4.210.0080.04015.10
5.4.200.0070.03815.15
5.4.190.0020.03815.10
5.4.180.0040.04415.11
5.4.170.0080.03715.19
5.4.160.0030.04015.09
5.4.150.0030.04115.05
5.4.140.0030.04213.80
5.4.130.0070.03913.71
5.4.120.0080.02813.80
5.4.110.0080.03313.83
5.4.100.0060.03813.77
5.4.90.0060.02413.83
5.4.80.0040.02813.77
5.4.70.0080.03413.88
5.4.60.0030.03013.77
5.4.50.0080.03613.74
5.4.40.0030.04013.83
5.4.30.0070.02713.77
5.4.20.0050.03713.71
5.4.10.0020.03513.80
5.4.00.0080.02613.46
5.3.290.0070.04213.02
5.3.280.0030.03813.02
5.3.270.0020.02513.02
5.3.260.0050.02513.02
5.3.250.0030.03313.02
5.3.240.0070.04213.02
5.3.230.0070.04013.02
5.3.220.0080.02213.02
5.3.210.0120.03813.02
5.3.200.0070.03313.02
5.3.190.0000.02413.02
5.3.180.0110.03013.02
5.3.170.0020.02713.02
5.3.160.0050.03313.02
5.3.150.0120.03213.02
5.3.140.0080.02313.02
5.3.130.0030.04513.02
5.3.120.0120.02713.02
5.3.110.0080.03813.02
5.3.100.0100.03713.02
5.3.90.0020.04013.02
5.3.80.0030.02513.02
5.3.70.0070.03713.02
5.3.60.0100.03613.02
5.3.50.0060.04113.02
5.3.40.0070.04213.02
5.3.30.0030.02513.02
5.3.20.0050.03013.02
5.3.10.0030.02213.02
5.3.00.0020.03713.02
5.2.170.0050.02913.02
5.2.160.0050.03213.02
5.2.150.0070.03013.02
5.2.140.0070.03213.02
5.2.130.0040.02813.02
5.2.120.0050.02013.02
5.2.110.0100.03013.02
5.2.100.0020.03513.02
5.2.90.0060.03113.02
5.2.80.0030.03513.02
5.2.70.0050.03113.02
5.2.60.0030.03513.02
5.2.50.0050.02113.02
5.2.40.0080.03013.02
5.2.30.0070.01713.02
5.2.20.0060.01613.02
5.2.10.0050.03013.02
5.2.00.0050.01813.02
5.1.60.0050.02913.02
5.1.50.0050.03013.02
5.1.40.0030.02913.02
5.1.30.0060.02613.02
5.1.20.0050.03013.02
5.1.10.0050.01513.02
5.1.00.0080.02013.02
5.0.50.0020.01913.02
5.0.40.0030.02613.02
5.0.30.0000.03613.02
5.0.20.0050.02213.02
5.0.10.0050.02213.02
5.0.00.0020.03513.02
4.4.90.0030.01713.02
4.4.80.0030.01813.02
4.4.70.0020.01113.02
4.4.60.0020.01213.02
4.4.50.0020.02013.02
4.4.40.0030.02513.02
4.4.30.0020.01313.02
4.4.20.0020.01813.02
4.4.10.0050.01813.02
4.4.00.0050.01813.02
4.3.110.0060.01813.02
4.3.100.0050.01813.02
4.3.90.0000.01913.02
4.3.80.0020.03113.02
4.3.70.0020.01513.02
4.3.60.0050.01713.02
4.3.50.0050.01513.02
4.3.40.0030.02513.02
4.3.30.0020.01813.02
4.3.20.0030.02013.02
4.3.10.0020.02213.02
4.3.00.0020.01913.02

preferences:
52.83 ms | 401 KiB | 5 Q