3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json = '[{ "thn": "2017", "jumlah": "30" }, { "thn": "2018", "jumlah": "80" }, { "thn": "2018", "jumlah": "64" }, { "thn": "2018", "jumlah": "5" }, { "thn": "2018", "jumlah": "1" }, { "thn": "2018", "jumlah": "1" }, { "thn": "2018", "jumlah": "4" }, { "thn": "2018", "jumlah": "5" }, { "thn": "2018", "jumlah": "198" }, { "thn": "2018", "jumlah": "2" }, { "thn": "2018", "jumlah": "202" }, { "thn": "2019", "jumlah": "31" }, { "thn": "2019", "jumlah": "1" }]'; $array = json_decode($json,true); $finalArray = array(); foreach($array as $arr){ $finalArray[$arr['thn']]['jumlah'] = (isset($finalArray[$arr['thn']]['jumlah']) ? $finalArray[$arr['thn']]['jumlah'] + $arr['jumlah']: $arr['jumlah']); $finalArray[$arr['thn']]['thn'] = $arr['thn']; } $finalArray = array_values($finalArray); echo json_encode($finalArray);

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.0090.00618.31
8.3.50.0070.01016.61
8.3.40.0150.00018.98
8.3.30.0090.00918.78
8.3.20.0000.00820.75
8.3.10.0030.00620.16
8.3.00.0000.00818.77
8.2.180.0150.00618.18
8.2.170.0120.00322.96
8.2.160.0130.00720.46
8.2.150.0030.00624.18
8.2.140.0070.00024.66
8.2.130.0070.00026.16
8.2.120.0020.00519.89
8.2.110.0040.00422.25
8.2.100.0080.00318.03
8.2.90.0000.00819.70
8.2.80.0060.00318.05
8.2.70.0080.00017.88
8.2.60.0080.00018.05
8.2.50.0030.00518.07
8.2.40.0090.00318.19
8.2.30.0070.00018.26
8.2.20.0070.00018.07
8.2.10.0050.00219.39
8.2.00.0040.00419.32
8.1.280.0100.00325.92
8.1.270.0070.00320.68
8.1.260.0070.00426.35
8.1.250.0040.00428.09
8.1.240.0160.00020.56
8.1.230.0080.00420.89
8.1.220.0040.00421.07
8.1.210.0060.00318.77
8.1.200.0060.00317.22
8.1.190.0040.00417.35
8.1.180.0080.00018.10
8.1.170.0040.00418.54
8.1.160.0000.00718.91
8.1.150.0020.00518.79
8.1.140.0050.00218.89
8.1.130.0050.00317.40
8.1.120.0040.00817.42
8.1.110.0030.00617.49
8.1.100.0030.00617.50
8.1.90.0070.00017.41
8.1.80.0030.00317.39
8.1.70.0060.00317.53
8.1.60.0060.00317.65
8.1.50.0030.00617.43
8.1.40.0030.00517.50
8.1.30.0060.00817.66
8.1.20.0000.00817.63
8.1.10.0050.00317.64
8.1.00.0040.00417.55
8.0.300.0000.00821.95
8.0.290.0050.00316.75
8.0.280.0000.00718.46
8.0.270.0030.00318.14
8.0.260.0000.00617.02
8.0.250.0000.00717.07
8.0.240.0030.00317.07
8.0.230.0000.00717.03
8.0.220.0070.00017.00
8.0.210.0040.00416.86
8.0.200.0030.00316.91
8.0.190.0000.00716.91
8.0.180.0000.00816.99
8.0.170.0030.00617.01
8.0.160.0040.00416.94
8.0.150.0080.00316.91
8.0.140.0070.00017.03
8.0.130.0000.00613.44
8.0.120.0000.00716.88
8.0.110.0000.00716.81
8.0.100.0040.00416.88
8.0.90.0040.00417.05
8.0.80.0110.00616.91
8.0.70.0000.00716.80
8.0.60.0050.00316.82
8.0.50.0040.00417.04
8.0.30.0070.01017.08
8.0.20.0090.01017.21
8.0.10.0080.00017.00
8.0.00.0120.00616.85
7.4.330.0000.00615.55
7.4.320.0000.00616.60
7.4.300.0060.00016.43
7.4.290.0040.00416.55
7.4.280.0040.00416.63
7.4.270.0030.00316.53
7.4.260.0000.00613.25
7.4.250.0000.00716.46
7.4.240.0060.00116.60
7.4.230.0000.00716.62
7.4.220.0020.00516.53
7.4.210.0090.01016.59
7.4.200.0080.00016.46
7.4.130.0050.01416.49
7.4.120.0140.00316.52
7.4.110.0030.01316.80
7.4.100.0120.00616.44
7.4.90.0180.00016.58
7.4.80.0090.01219.39
7.4.70.0090.01416.54
7.4.60.0090.00716.59
7.4.50.0110.00716.64
7.4.40.0070.01016.62
7.4.20.0140.01016.60
7.4.10.0160.01016.61
7.4.00.0090.01616.69
7.3.330.0030.00616.14
7.3.320.0030.00313.20
7.3.310.0070.00016.40
7.3.300.0030.00316.37
7.3.290.0070.01016.33
7.3.260.0100.00716.44
7.3.240.0080.01016.39
7.3.230.0140.00716.61
7.3.210.0070.01016.32
7.3.200.0130.00316.57
7.3.190.0100.00716.43
7.3.180.0150.00416.46
7.3.170.0060.01016.62
7.3.160.0060.00916.55
7.3.140.0060.01216.41
7.3.130.0120.00616.61
7.3.120.0070.01416.45
7.3.110.0130.00616.37
7.3.100.0090.00916.39
7.3.90.0100.00716.42
7.3.80.0110.00416.61
7.3.70.0130.00316.50
7.3.60.0000.01516.46
7.3.50.0130.00316.46
7.3.40.0060.00916.33
7.3.30.0080.00816.27
7.3.20.0130.00916.25
7.3.10.0090.01216.58
7.3.00.0060.00916.54
7.2.330.0080.01116.54
7.2.320.0100.00616.58
7.2.310.0100.00716.42
7.2.300.0110.00616.48
7.2.290.0080.00816.60
7.2.270.0040.01716.55
7.2.260.0150.01216.51
7.2.250.0060.01816.69
7.2.240.0090.00916.72
7.2.230.0080.00816.31
7.2.220.0130.00316.65
7.2.210.0030.01416.54
7.2.200.0130.00616.56
7.2.190.0060.01216.55
7.2.180.0100.00716.63
7.2.170.0120.00916.75
7.2.160.0070.01116.49
7.2.150.0100.01016.59
7.2.140.0060.01316.75
7.2.130.0120.00916.75
7.2.120.0080.01016.55
7.2.110.0090.00916.50
7.2.100.0140.00616.57
7.2.90.0060.01316.70
7.2.80.0030.01616.65
7.2.70.0100.01016.83
7.2.60.0040.01616.54
7.2.50.0160.00416.51
7.2.40.0000.01916.78
7.2.30.0090.00916.74
7.2.20.0060.01216.54
7.2.10.0210.01516.64
7.2.00.0070.01116.62

preferences:
55.05 ms | 400 KiB | 5 Q