3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json_data = '[ {"name":"Location 1","gigs": {"start":"16:30","end":"21:15","title":"TestTitle1","class":"fri"} }, {"name":"Location 2","gigs": {"start":"15:00","end":"19:00","title":"TestTitle2","class":"fri"} }, {"name":"Location 1","gigs": {"start":"21:00","end":"22:00","title":"TestTitle3","class":"fri"} } ]'; $arr = json_decode($json_data,true); $new_array = array(); foreach ($arr as $key => $value) { if(isset($new_array[$value['name']])) $new_array[$value['name']]['gigs'][] = $value['gigs']; //add already array existing value else{ $new_array[$value['name']]['name'] = $value['name']; $new_array[$value['name']]['gigs'][] = $value['gigs']; //create array } } $new_array = array_values($new_array); //to remove keys echo json_encode($new_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.3.70.0150.00318.43
8.3.60.0150.00418.31
8.3.50.0140.00717.38
8.3.40.0080.00818.97
8.3.30.0000.01518.84
8.3.20.0000.00720.32
8.3.10.0030.00622.09
8.3.00.0080.00020.93
8.2.190.0130.00316.58
8.2.180.0040.01818.42
8.2.170.0100.00622.96
8.2.160.0110.00319.39
8.2.150.0070.00024.18
8.2.140.0080.00024.66
8.2.130.0020.00526.16
8.2.120.0000.00719.91
8.2.110.0070.00320.58
8.2.100.0080.00417.72
8.2.90.0040.00418.16
8.2.80.0000.00919.16
8.2.70.0070.00317.75
8.2.60.0080.00018.05
8.2.50.0060.00318.22
8.2.40.0080.00020.34
8.2.30.0050.00219.35
8.2.20.0000.00818.17
8.2.10.0000.00918.22
8.2.00.0040.00418.23
8.1.280.0070.00725.92
8.1.270.0080.00022.19
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0000.00822.11
8.1.230.0050.00520.96
8.1.220.0080.00017.74
8.1.210.0050.00518.77
8.1.200.0000.00817.35
8.1.190.0040.00417.22
8.1.180.0080.00018.10
8.1.170.0040.00418.62
8.1.160.0020.00518.93
8.1.150.0040.00422.10
8.1.140.0040.00419.53
8.1.130.0040.00419.14
8.1.120.0040.00417.36
8.1.110.0050.00217.40
8.1.100.0000.00817.52
8.1.90.0030.00417.51
8.1.80.0030.00517.46
8.1.70.0040.00417.50
8.1.60.0030.00617.63
8.1.50.0040.00417.59
8.1.40.0020.00517.51
8.1.30.0030.00517.71
8.1.20.0070.00017.70
8.1.10.0050.00317.57
8.1.00.0070.00017.51
8.0.300.0000.00720.21
8.0.290.0000.00816.58
8.0.280.0030.00518.49
8.0.270.0040.00417.19
8.0.260.0050.00316.79
8.0.250.0070.00016.89
8.0.240.0040.00417.04
8.0.230.0000.00716.98
8.0.220.0040.00416.96
8.0.210.0040.00416.92
8.0.200.0030.00317.05
8.0.190.0120.00017.01
8.0.180.0000.00817.02
8.0.170.0040.00416.96
8.0.160.0030.00316.97
8.0.150.0070.00016.83
8.0.140.0050.00316.87
8.0.130.0000.00613.29
8.0.120.0030.00516.91
8.0.110.0040.00416.94
8.0.100.0080.00016.94
8.0.90.0000.00817.00
8.0.80.0110.00316.95
8.0.70.0030.00517.00
8.0.60.0000.00816.93
8.0.50.0000.00716.88
8.0.30.0050.01417.08
8.0.20.0110.00917.40
8.0.10.0070.00016.93
8.0.00.0060.01216.75
7.4.330.0050.00015.55
7.4.320.0000.00916.54
7.4.300.0060.00016.55
7.4.290.0030.00316.49
7.4.280.0000.00816.46
7.4.270.0030.00316.45
7.4.260.0000.00816.64
7.4.250.0000.00716.50
7.4.240.0000.00816.54
7.4.230.0000.00716.43
7.4.220.0090.00916.63
7.4.210.0110.00316.66
7.4.200.0040.00416.44
7.4.160.0070.00916.58
7.4.150.0070.01017.40
7.4.140.0110.00817.86
7.4.130.0070.01416.60
7.4.120.0110.01016.56
7.4.110.0060.01016.65
7.4.100.0130.00916.63
7.4.90.0100.00716.62
7.4.80.0100.01019.39
7.4.70.0130.00316.41
7.4.60.0090.01216.66
7.4.50.0060.01016.29
7.4.40.0120.00616.46
7.4.30.0090.00916.39
7.4.00.0000.01715.02
7.3.330.0050.00013.11
7.3.320.0030.00313.10
7.3.310.0000.00716.43
7.3.300.0070.00016.41
7.3.290.0030.00316.35
7.3.280.0100.00716.33
7.3.270.0030.01417.40
7.3.260.0020.01516.42
7.3.250.0090.00916.37
7.3.240.0090.01016.37
7.3.230.0060.01016.60
7.3.210.0130.00616.67
7.3.200.0030.01616.65
7.3.190.0000.01616.52
7.3.180.0140.00316.57
7.3.170.0090.00616.48
7.3.160.0040.01216.52
7.2.330.0140.00416.76
7.2.320.0110.01116.87
7.2.310.0120.00416.63
7.2.300.0120.00616.87
7.2.290.0130.01016.82
7.2.60.0070.00716.62
7.1.200.0100.00715.75
7.1.80.4100.01916.54
7.1.70.5360.01415.39
7.1.60.5170.02033.18
7.1.50.4100.01333.10
7.1.40.4200.00732.78
7.1.30.5880.02032.68
7.1.20.3720.01032.98
7.1.10.3630.00714.88
7.1.00.3410.00315.01
7.0.200.6040.01015.04
7.0.190.5190.00714.66
7.0.180.4130.01614.55
7.0.170.6380.01114.37
7.0.160.5050.00314.54
7.0.150.4080.01314.44
7.0.140.4230.01014.70
7.0.130.3130.01314.68
7.0.120.3090.01014.82
7.0.110.2930.01014.51
7.0.100.3100.00714.68
7.0.90.3090.01014.56
7.0.80.2810.01714.31
7.0.70.2430.00714.38
7.0.60.2950.00614.32
7.0.50.2530.00314.71
7.0.40.3070.01014.63
7.0.30.3230.01214.57
7.0.20.2480.01014.64
7.0.10.2410.00714.68
7.0.00.2500.00714.80

preferences:
68.3 ms | 401 KiB | 5 Q