3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 0 => [ "user_type" => 'Trainee', "total_count" => 3, ] ]; $array_column = array_column($array, 'total_count', 'user_type'); //Create new array like below $add_array = array('Manager'=>'0', 'Director'=>'0', 'Trainee'=>'0',); //using array_merge merge add_array and array_column $new_array = array_merge($add_array, $array_column); //using array_walk_recursive get the requird result array_walk_recursive($new_array, function($item, $key) use (&$final_array){ $final_array['labels'][]=$key; $final_array['dataset'][]=$item; }); echo "<pre>"; print_r($final_array); ?>

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.4.120.0110.00922.36
8.4.110.0120.00819.00
8.4.100.0110.00617.86
8.4.90.0120.00922.52
8.4.80.0110.00822.70
8.4.70.0150.00717.66
8.4.60.0080.01120.53
8.4.50.0150.00718.76
8.4.40.0070.00317.38
8.4.30.0160.00320.41
8.4.20.0150.00620.46
8.4.10.0070.00417.65
8.3.250.0040.00419.05
8.3.240.0030.00416.45
8.3.230.0110.00816.90
8.3.220.0050.00218.98
8.3.210.0090.01016.71
8.3.200.0050.00416.69
8.3.190.0040.00317.14
8.3.180.0080.01218.86
8.3.170.0040.01117.30
8.3.160.0070.01018.43
8.3.150.0120.00621.13
8.3.140.0070.00720.73
8.3.130.0040.00418.42
8.3.120.0060.00318.90
8.3.110.0050.00316.88
8.3.100.0080.00024.06
8.3.90.0040.00426.77
8.3.80.0040.00418.30
8.3.70.0110.01118.68
8.3.60.0100.01016.75
8.3.50.0140.00422.13
8.3.40.0070.00718.63
8.3.30.0110.00418.79
8.3.20.0040.00421.90
8.3.10.0000.00721.92
8.3.00.0000.00723.66
8.2.290.0100.00918.38
8.2.280.0090.00918.34
8.2.270.0130.00616.59
8.2.260.0040.01418.84
8.2.250.0090.00617.03
8.2.240.0060.01319.09
8.2.230.0070.01020.94
8.2.220.0150.00437.54
8.2.210.0110.00726.77
8.2.200.0040.00716.63
8.2.190.0090.00616.60
8.2.180.0120.00616.38
8.2.170.0110.00422.96
8.2.160.0070.00720.57
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0000.00726.16
8.2.120.0000.00820.51
8.2.110.0070.00320.89
8.2.100.0080.00419.63
8.2.90.0000.00819.40
8.2.80.0040.00418.16
8.2.70.0000.00817.48
8.2.60.0040.00417.93
8.2.50.0050.00318.07
8.2.40.0030.00618.28
8.2.30.0080.00018.12
8.2.20.0000.00818.05
8.2.10.0040.00419.32
8.2.00.0000.00819.43
8.1.330.0140.00416.08
8.1.320.0060.00316.19
8.1.310.0040.01417.01
8.1.300.0080.00017.75
8.1.290.0040.00418.88
8.1.280.0110.00725.92
8.1.270.0080.00022.24
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0100.00019.13
8.1.230.0060.00619.14
8.1.220.0070.00017.74
8.1.210.0000.00818.77
8.1.200.0060.00317.13
8.1.190.0040.00417.65
8.1.180.0040.00418.69
8.1.170.0080.00018.59
8.1.160.0050.00322.16
8.1.150.0070.00018.91
8.1.140.0040.00420.97
8.1.130.0050.00317.48
8.1.120.0000.00717.38
8.1.110.0070.00017.46
8.1.100.0030.00517.49
8.1.90.0080.00017.38
8.1.80.0060.00317.53
8.1.70.0000.00717.36
8.1.60.0060.00317.50
8.1.50.0040.00417.58
8.1.40.0040.00417.55
8.1.30.0040.00417.71
8.1.20.0070.00317.68
8.1.10.0000.00817.57
8.1.00.0040.00417.43
8.0.300.0060.00318.77
8.0.290.0000.00717.16
8.0.280.0030.00318.53
8.0.270.0000.00717.33
8.0.260.0030.00316.79
8.0.250.0020.00516.95
8.0.240.0000.00817.02
8.0.230.0000.00716.99
8.0.220.0040.00416.98
8.0.210.0000.00716.80
8.0.200.0000.00616.99
8.0.190.0040.00416.93
8.0.180.0030.00616.90
8.0.170.0030.00616.93
8.0.160.0040.00416.97
8.0.150.0070.00016.91
8.0.140.0040.00416.85
8.0.130.0000.00613.30
8.0.120.0070.00016.81
8.0.110.0030.00516.91
8.0.100.0000.00816.91
8.0.90.0030.00616.95
8.0.80.0070.00716.89
8.0.70.0040.00416.79
8.0.60.0070.00016.89
8.0.50.0000.00816.85
8.0.30.0100.00717.30
8.0.20.0040.01517.20
8.0.10.0040.00417.08
8.0.00.0110.00716.84
7.4.330.0020.00215.55
7.4.320.0000.00816.54
7.4.300.0060.00016.44
7.4.290.0060.00316.57
7.4.280.0000.00816.51
7.4.270.0030.00316.63
7.4.260.0050.00013.29
7.4.250.0030.00316.46
7.4.240.0020.00516.65
7.4.230.0000.00716.60
7.4.220.0030.00516.57
7.4.210.0070.00916.51
7.4.200.0070.00016.58
7.4.140.0090.00917.86
7.4.130.0150.00316.47
7.4.120.0130.00316.60
7.4.110.0080.00816.35
7.4.100.0070.01116.64
7.4.90.0100.00716.59
7.4.80.0030.01319.39
7.4.70.0070.01016.54
7.4.60.0080.00916.60
7.4.50.0100.00316.36
7.4.40.0120.00616.63
7.4.00.0130.00014.76
7.3.330.0030.00316.47
7.3.320.0070.00013.38
7.3.310.0030.00316.41
7.3.300.0070.00016.34
7.3.290.0000.00716.33
7.3.280.0050.01116.32
7.3.260.0120.00716.45
7.3.240.0100.00716.38
7.3.230.0070.01016.58
7.3.210.0150.00916.38
7.3.200.0060.00916.40
7.3.190.0110.00716.52
7.3.180.0040.01416.40
7.3.170.0090.00916.65
7.3.160.0030.01316.71
7.3.70.0140.00414.91
7.3.60.0060.00614.78
7.3.50.0090.00314.90
7.3.40.0060.00614.39
7.3.30.0060.00914.77
7.3.20.0120.00614.59
7.3.10.0070.00714.92
7.3.00.0100.00314.66
7.2.330.0030.01516.40
7.2.320.0140.00916.86
7.2.310.0060.01116.51
7.2.300.0070.01016.53
7.2.290.0150.00716.67
7.2.200.0090.00314.84
7.2.190.0050.00515.04
7.2.180.0120.00315.04
7.2.170.0150.00014.74
7.2.160.0080.00315.07
7.2.150.0210.00014.98
7.2.140.0100.00314.90
7.2.130.0090.00915.23
7.2.120.0120.00915.20
7.2.110.0090.00614.96
7.2.100.0170.00014.93
7.2.90.0060.01215.17
7.2.80.0130.00415.12
7.2.70.0130.00615.13
7.2.60.0110.00415.09
7.2.50.0090.00914.93
7.2.40.0070.00714.86
7.2.30.0060.01515.15
7.2.20.0110.01114.97
7.2.10.0130.00715.03
7.2.00.0130.00615.09
7.1.300.0090.00314.15
7.1.290.0070.01113.99
7.1.280.0100.00613.89
7.1.270.0030.01314.00
7.1.260.0320.00013.83
7.1.250.0110.00314.00

preferences:
28.05 ms | 403 KiB | 5 Q